Table of Contents

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

NameTypeDescription
val HoldType

The value to check

Returns

bool

true if all Disable flags have been set, true otherwise.

Remarks

See Remarks under HoldType.

IsIn<T>(T, params T[])

public static bool IsIn<T>(this T target, params T[] values) where T : struct

Parameters

NameTypeDescription
target T
values T[]

Returns

bool

Type Parameters

NameDescription
T

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

NameTypeDescription
source string

Returns

T?

Type Parameters

NameDescription
T

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

NameTypeDescription
source string
defaultValue T

Returns

T

Type Parameters

NameDescription
T