Class EnumHelpers
- Namespace
- ArcanaDevelopment.adTempus.Shared
- Assembly
- ArcanaDevelopment.adTempus.Shared.dll
Extension methods for working with various enums
public static class EnumHelpers
- Inheritance
-
object
EnumHelpers
Methods
IsAllHeld(HoldType)
Checks to see if a HoldType value has flags set to disable all execution.
public static bool IsAllHeld(this HoldType val)
Parameters
| Name | Type | Description |
val |
HoldType |
The value to check
|
Returns
- bool
true if all Disable flags have been set, true otherwise.
IsIn<T>(T, params T[])
public static bool IsIn<T>(this T target, params T[] values) where T : struct
Parameters
| Name | Type | Description |
target |
T |
|
values |
T[] |
|
Returns
- bool
Type Parameters
ParseEnum<T>(string)
Parses an enum value from a string, which may contain either the text or numeric value for the enum.
public static T? ParseEnum<T>(string source) where T : struct, Enum
Parameters
| Name | Type | Description |
source |
string |
|
Returns
- T?
Type Parameters
ParseEnum<T>(string, T)
Parses an enum value from a string, which may contain either the text or numeric value for the enum.
public static T ParseEnum<T>(string source, T defaultValue) where T : struct, Enum
Parameters
| Name | Type | Description |
source |
string |
|
defaultValue |
T |
|
Returns
- T
Type Parameters