System.ComponentModel.TypeDescriptor.ShouldHideMember C# (CSharp) Метод

ShouldHideMember() приватный статический Метод

This function takes a member descriptor and an attribute and determines whether the member satisfies the particular attribute. This either means that the member contains the attribute or the member does not contain the attribute and the default for the attribute matches the passed in attribute.
private static ShouldHideMember ( MemberDescriptor member, Attribute attribute ) : bool
member MemberDescriptor
attribute System.Attribute
Результат bool
        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);
            }
        }