Reflection supports returning custom attributes defined directly on a member (non-inherited) thought the ICustomAttributeProvider interface. This interface is defined on MemberInfo, ParamaterInfo, Module and Assembly.
interface ICustomAttributeProvider { public object[] GetCustomAttributes(Type attributeType); public object[] GetCustomAttributes(); public bool IsDefined (Type attributeType); }
Returns an array of instances of customAttributeType or null if non-exists on this member. If customAttributeType is a base class or interface this method will return any implementation of that type. Throws an AmbiguousMatchException if there is more than one attribute of type customAttributeType defined on this member. Does NOT do any inheritance walk. The array returned must be an array of the type specified.
Returns an instance of each custom attribute defined on the given on this member or an empty array if non-exists. If customAttributeType is a base class or interface this method will return any implementation of that type. Does NOT do any inheritance walk.
Returns true if one or more instance of attributeType is defined on this member.