Class EnumUtility
Enum Utility Methods.
Inheritance
Inherited Members
Namespace: StansAssets.Foundation
Assembly: cs.temp.dll.dll
Syntax
public static class EnumUtility
Methods
CanBeParsed<T>(String, Boolean)
Checks if the string representation of the name or numeric value of one or more enumerated constants can be converted to an equivalent enumerated object.
Declaration
public static bool CanBeParsed<T>(string value, bool ignoreCase = true)
where T : struct, Enum
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The string representation of the name or numeric value of one or more enumerated constants. |
System.Boolean | ignoreCase |
|
Returns
Type | Description |
---|---|
System.Boolean | Returns |
Type Parameters
Name | Description |
---|---|
T | The enum type to use for parsing. |
ParseOrDefault<T>(String, Boolean)
Converts the string representation of the name or numeric value of one or more enumerated constants to an equivalent enumerated object.
Declaration
public static T ParseOrDefault<T>(string value, bool ignoreCase = true)
where T : struct, Enum
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The string representation of the name or numeric value of one or more enumerated constants. |
System.Boolean | ignoreCase |
|
Returns
Type | Description |
---|---|
T | Enumeration constant that represents the parsed |
Type Parameters
Name | Description |
---|---|
T | The enum type to use for parsing. |
TryParse<T>(String, out T, Boolean)
Converts the string representation of the name or numeric value of one or more enumerated constants to an equivalent enumerated object.
Declaration
public static bool TryParse<T>(string value, out T result, bool ignoreCase = true)
where T : struct, Enum
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The string representation of the name or numeric value of one or more enumerated constants. |
T | result | When this method returns |
System.Boolean | ignoreCase |
|
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
T | The enum type to use for parsing. |