次の方法で共有


Extension.ToEnum Method

Definition

Overloads

ToEnum<T>(Int32)

Converts a int to a Enum of the requested type (T)

ToEnum<T>(String)

Enum extension

ToEnum<T>(Int32)

Converts a int to a Enum of the requested type (T)

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static T ToEnum(int enumValue);
public static T ToEnum<T> (this int enumValue);
static member ToEnum : int -> 'T
<Extension()>
Public Function ToEnum(Of T) (enumValue As Integer) As T

Type Parameters

T

Enum Type to translate too

Parameters

enumValue
Int32

Int Value too translate.

Returns

T

Enum of Type T

Applies to

ToEnum<T>(String)

Enum extension

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static T ToEnum(System::String ^ enumName);
public static T ToEnum<T> (this string enumName);
static member ToEnum : string -> 'T
<Extension()>
Public Function ToEnum(Of T) (enumName As String) As T

Type Parameters

T

Parameters

enumName
String

Returns

T

Enum Value

Applies to