Skip to main content
Version: 15.x (API 15) [Current]

Class EnumExtensions

Extension methods for enums.

Assembly: Dalamud.dll​
Declaration
public static class EnumExtensions

Methods​

GetAttributes<TAttribute>(Enum)​

Gets attributes on an enum.

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​
TypeNameDescription
System.EnumvalueThe enum value that has an attached attribute.
Type Parameters​
NameDescription
TAttributeThe type of attribute to get.

GetAttribute<TAttribute>(Enum)​

Gets an attribute on an enum.

Declaration
public static TAttribute? GetAttribute<TAttribute>(this Enum value) where TAttribute : Attribute
Returns​

<TAttribute>: The attached attribute, if any.

Parameters​
TypeNameDescription
System.EnumvalueThe enum value that has an attached attribute.
Type Parameters​
NameDescription
TAttributeThe type of attribute to get.

IsObsolete(Enum)​

Gets an indicator if enum has been flagged as obsolete (deprecated).

Declaration
public static bool IsObsolete(this Enum value)
Returns​

System.Boolean: Indicator if enum has been flagged as obsolete.

Parameters​
TypeNameDescription
System.EnumvalueThe enum value that has an attached attribute.