private static bool ShouldHideMember(MemberDescriptor member, Attribute attribute)
{
if (member == null || attribute == null)
{
return true;
}
Attribute memberAttribute = member.Attributes[attribute.GetType()];
if (memberAttribute == null)
{
return !attribute.IsDefaultAttribute();
}
else
{
return !attribute.Equals(memberAttribute);
}
}