Class EnumUtilityExtensions
This is an extension implementation of the most common methods on the EnumUtility class.
Inheritance
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public static class EnumUtilityExtensions
Methods
| Improve this DocToEnum<TEnum>(String)
Converts the string representation of the name or numeric value
of one or more enumerated constants to an equivalent enumerated TEnum
.
Declaration
public static TEnum ToEnum<TEnum>(this string value)
where TEnum : struct, IConvertible
Parameters
Type | Name | Description |
---|---|---|
System.String | value | A string containing the name or value to convert. |
Returns
Type | Description |
---|---|
TEnum | An enum of type |
Type Parameters
Name | Description |
---|---|
TEnum | The type of the enumeration to convert. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
TypeArgumentException |
|
System.ArgumentException |
|
ToEnum<TEnum>(String, Boolean)
Converts the string representation of the name or numeric value
of one or more enumerated constants to an equivalent enumerated TEnum
.
Declaration
public static TEnum ToEnum<TEnum>(this string value, bool ignoreCase)
where TEnum : struct, IConvertible
Parameters
Type | Name | Description |
---|---|---|
System.String | value | A string containing the name or value to convert. |
System.Boolean | ignoreCase |
|
Returns
Type | Description |
---|---|
TEnum | An enum of type |
Type Parameters
Name | Description |
---|---|
TEnum | The type of the enumeration to convert. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
TypeArgumentException |
|
System.ArgumentException |
|