Class EnumExtensions
Extension methods for enums.
Assembly: Dalamud.dll
View Source
Declaration
public static class EnumExtensions
Methods
GetAttributes<TAttribute>(Enum)
Gets attributes on an enum.
View Source
Declaration
public static IEnumerable<TAttribute> GetAttributes<TAttribute>(this Enum value) where TAttribute : Attribute
Returns
System.Collections.Generic.IEnumerable<<TAttribute>>
: The enumerable of the attached attributes.
Parameters
Type | Name | Description |
---|---|---|
System.Enum | value | The enum value that has an attached attribute. |
Type Parameters
Name | Description |
---|---|
TAttribute | The type of attribute to get. |
GetAttribute<TAttribute>(Enum)
Gets an attribute on an enum.
View Source
Declaration
public static TAttribute? GetAttribute<TAttribute>(this Enum value) where TAttribute : Attribute
Returns
<TAttribute>
: The attached attribute, if any.
Parameters
Type | Name | Description |
---|---|---|
System.Enum | value | The enum value that has an attached attribute. |
Type Parameters
Name | Description |
---|---|
TAttribute | The type of attribute to get. |
IsObsolete(Enum)
Gets an indicator if enum has been flagged as obsolete (deprecated).
View Source
Declaration
public static bool IsObsolete(this Enum value)
Returns
System.Boolean
: Indicator if enum has been flagged as obsolete.
Parameters
Type | Name | Description |
---|---|---|
System.Enum | value | The enum value that has an attached attribute. |