Class EnumType
Provides reflection helpers for enum types.
Inherited Members
Namespace: DotNext.Reflection
Assembly: DotNext.dll
Syntax
public static class EnumType
Methods
| Edit this page View SourceGetCustomAttribute<TEnum, TAttribute>(TEnum)
Gets custom attribute associated with the specified enum value.
Declaration
public static TAttribute? GetCustomAttribute<TEnum, TAttribute>(this TEnum value) where TEnum : struct, Enum where TAttribute : Attribute
Parameters
Type | Name | Description |
---|---|---|
TEnum | value | The value to be reflected. |
Returns
Type | Description |
---|---|
TAttribute | A custom attribute that matches |
Type Parameters
Name | Description |
---|---|
TEnum | The type of the enum to be reflected. |
TAttribute | The type of attribute to search for. |
GetCustomAttributes<TEnum, TAttribute>(TEnum)
Gets custom attributes associayed with the specified enum value.
Declaration
public static IEnumerable<TAttribute> GetCustomAttributes<TEnum, TAttribute>(this TEnum value) where TEnum : struct, Enum where TAttribute : Attribute
Parameters
Type | Name | Description |
---|---|---|
TEnum | value | The value to be reflected. |
Returns
Type | Description |
---|---|
IEnumerable<TAttribute> | A collection of the custom attributes associated with |
Type Parameters
Name | Description |
---|---|
TEnum | The type of the enum to be reflected. |
TAttribute | The type of attribute to search for. |