The MSDN Documentation: MemberInfo.GetCustomAttibutes Method (Type, Boolean) states in the remarks:
This method ignores the inherit parameter for properties and events. To search the inheritance chain for attributes on properties and events, use the appropriate overloads of the Attribute.GetCustomAttributes method.
This basically means that this implementation's second parameter (bool inherit
) is ignored for event members and property members. However, calling the Attribute.GetCustomAttributes(MemberInfo,Type,bool)
variety of this operation does not.
What puzzles me is the design of this.
Why would they seemingly ignore the inherit attribute arbitrarily on 2 forms of member types?
If anyone could shed some light on this I'd be greatly appreciative.