public override bool Equals(object obj)
{
try
{
if (obj == this)
{
return true;
}
if (obj == null)
{
return false;
}
// Assume that 90% of the time we will only do a .Equals(...) for
// propertydescriptor vs. propertydescriptor... avoid the overhead
// of an instanceof call.
PropertyDescriptor pd = obj as PropertyDescriptor;
if (pd != null && pd.NameHashCode == NameHashCode
&& pd.PropertyType == PropertyType
&& pd.Name.Equals(Name))
{
return true;
}
}
catch { }
return false;
}