Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: TAttribute[] GetCustomAttributes<TAttribute>(this Enum)

  • Declared in: RT.Util.Ut

Declaration

public static TAttribute[] GetCustomAttributes<TAttribute>(
    this Enum enumValue
)

Summary

Returns the set of custom attributes of the specified TAttribute type that are attached to the declaration of the enum value represented by enumValue.

Generic type parameters

TAttribute
  • Must derive from: System.Attribute.
The type of the custom attributes to retrieve.

Parameters

this EnumenumValue The enum value for which to retrieve the custom attributes.

Returns

An array containing the custom attributes, or null if enumValue does not correspond to a declared value.

Exceptions

  • System.ArgumentNullException
    enumValue is null.

Remarks

This method keeps an internal cache forever.