public override bool Equals(object obj)
{
if (this == obj)
{
return true;
}
if (obj == null)
{
return false;
}
if (obj.GetType() != GetType())
{
return false;
}
MemberDescriptor mdObj = (MemberDescriptor)obj;
FilterAttributesIfNeeded();
mdObj.FilterAttributesIfNeeded();
if (mdObj._nameHash != _nameHash)
{
return false;
}
if ((mdObj._category == null) != (_category == null) ||
(_category != null && !mdObj._category.Equals(_category)))
{
return false;
}
if ((mdObj._description == null) != (_description == null) ||
(_description != null && !mdObj._description.Equals(_description)))
{
return false;
}
if ((mdObj._attributes == null) != (_attributes == null))
{
return false;
}
bool sameAttrs = true;
if (_attributes != null)
{
if (_attributes.Length != mdObj._attributes.Length)
{
return false;
}
for (int i = 0; i < _attributes.Length; i++)
{
if (!_attributes[i].Equals(mdObj._attributes[i]))
{
sameAttrs = false;
break;
}
}
}
return sameAttrs;
}