System.Reflection.CustomAttributeExtensions.GetCustomAttributes Method

Retrieves a collection of custom attributes of a specified type that are applied to a specified member, and optionally inspects the ancestors of that member.

Syntax

public static IEnumerable<Attribute> GetCustomAttributes (this MemberInfo element, Type attributeType, bool inherit)

Parameters

element
The member to inspect.
attributeType
The type of attribute to search for.
inherit
true to inspect the ancestors of element; otherwise, false.

Returns

A collection of the custom attributes that are applied to element and that match attributeType, or an empty collection if no such attributes exist.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 4.0.0.0