Enum |
The EnumExtension type exposes the following members.
Name | Description | |
---|---|---|
GetAttributeTAttribute | This method retrieves a specific attribute (TAttribute) associated with the given enum value. It returns the attribute instance if found, or null if the attribute is not present. | |
GetDescriptionTEnum | This method retrieves the description attribute value associated with the given enum value. If a description attribute is defined for the enum value, it returns the description value. Otherwise, it returns the string representation of the enum value. | |
GetEnumValueFromDescriptionTEnum | This method searches for an enum value that has a description attribute matching the provided descriptionValue. It iterates through all values of the specified enum type and compares their descriptions. If a match is found, it returns the corresponding enum value. If no matching value is found, it throws an ArgumentException indicating that no enum value matches the given description attribute value. |