Diff<>(old, new, comparer, predicate, postProcessor) NewArray<>(size1, size2, size3, initialiser) RunMain(main, onUnhandledMain, onUnhandledThread) RunMain(main, onUnhandledMain, onUnhandledThread)
Legend Class Struct Enum Interface Delegate | Constructor Method Property Event Field |
| Extension method: TAttribute GetCustomAttribute<TAttribute>(this Enum)Declarationpublic static TAttribute GetCustomAttribute<TAttribute>(
this Enum enumValue
) Summary
Returns the single custom attribute of the specified TAttribute type that is attached
to the declaration of the enum value represented by enumValue, or null if there is
no such attribute. Generic type parametersTAttribute |
The type of the custom attribute to retrieve. |
Parametersthis Enum | enumValue |
The enum value for which to retrieve the custom attribute. |
Returns
The custom attribute, or null if the enum value does not have a custom attribute of the specified type
attached to it. If enumValue does not correspond to a declared enum value, or there is more
than one custom attribute of the same type, an exception is thrown. Exceptions- System.ArgumentNullException
enumValue is null . - System.InvalidOperationException
There is more than one custom attribute of the specified type attached to the enum value declaration.
Remarks
This method uses Ut.GetCustomAttributes<TAttribute>(this Enum), which keeps an internal cache
forever. |