CustomAttributeExtensions.GetCustomAttribute<T> Method (MemberInfo, Boolean)
Retrieves a custom attribute of a specified type that is applied to a specified member, and optionally inspects the ancestors of that member.
Assembly: mscorlib (in mscorlib.dll)
public static T GetCustomAttribute<T>( this MemberInfo element, bool inherit ) where T : Attribute
The member to inspect.
true to inspect the ancestors of element; otherwise, false.
A custom attribute that matches T, or null if no such attribute is found.
The type of attribute to search for.
Available since 8
Available since 4.5
Portable Class Library
Supported in: portable .NET platforms
Windows Phone Silverlight
Available since 8.0
Available since 8.1