System.Reflection.Emit.EnumBuilder.GetCustomAttributes Method

Returns all the custom attributes defined for this constructor.

Syntax

public override object[] GetCustomAttributes (bool inherit)

Parameters

inherit
Specifies whether to search this member's inheritance chain to find the attributes.

Returns

Returns an array of objects representing all the custom attributes of the constructor represented by this System.Reflection.Emit.ConstructorBuilder instance.

Remarks

As a workaround, to retrieve the custom attributes of a finished type, retrieve the type using Type.GetType and call System.Reflection.MemberInfo.GetCustomAttributes(bool) on the returned Type.

The following code sample illustrates the use of GetCustomAttribute in the context of System.Reflection.Emit.EnumBuilder.

code reference: EnumBuilder_SetCustomAttribute2#1

Requirements

Namespace: System.Reflection.Emit
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0