Class EnumHelper
A class which provides an extension method to get a Description from an enum. The enum must be decorated with a System.ComponentModel.DescriptionAttribute
Inheritance
System.Object
EnumHelper
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: OpenZiti
Assembly: Ziti.NET.Standard.dll
Syntax
public static class EnumHelper
Fields
| Improve this Doc View SourceNO_DESC
Declaration
public const string NO_DESC = "__NO DESCRIPTOIN AVAILABLE__"
Field Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceGetDescription(Enum)
Extension method to return the System.ComponentModel.DescriptionAttribute of the enum. If no System.ComponentModel.DescriptionAttribute exists, returns NO_DESC
Declaration
public static string GetDescription(this Enum enumVal)
Parameters
Type | Name | Description |
---|---|---|
System.Enum | enumVal | The enum in question to get the description from |
Returns
Type | Description |
---|---|
System.String |