Show / Hide Table of Contents

Class EnumConverter

Provides conversion between enum value and primitive types.

Inheritance
Object
EnumConverter
Namespace: DotNext
Assembly: DotNext.dll
Syntax
public static class EnumConverter : object

Methods

| Improve this Doc View Source

ToByte<T>(T)

Converts enum value into primitive type .

Declaration
public static byte ToByte<T>(this T value)

    where T : struct, Enum
Parameters
Type Name Description
T value

Enum value to be converted.

Returns
Type Description
Byte

Enum value represented as .

Type Parameters
Name Description
T

Type of the enum value to be converted.

| Improve this Doc View Source

ToEnum<T>(Byte)

Converts into enum of type T.

Declaration
public static T ToEnum<T>(this byte value)

    where T : struct, Enum
Parameters
Type Name Description
Byte value

The value to be converted.

Returns
Type Description
T

Enum value equals to the given value.

Type Parameters
Name Description
T

The target enum type.

| Improve this Doc View Source

ToEnum<T>(Int16)

Converts into enum of type T.

Declaration
public static T ToEnum<T>(this short value)

    where T : struct, Enum
Parameters
Type Name Description
Int16 value

The value to be converted.

Returns
Type Description
T

Enum value equals to the given value.

Type Parameters
Name Description
T

The target enum type.

| Improve this Doc View Source

ToEnum<T>(Int32)

Converts into enum of type T.

Declaration
public static T ToEnum<T>(this int value)

    where T : struct, Enum
Parameters
Type Name Description
Int32 value

The value to be converted.

Returns
Type Description
T

Enum value equals to the given value.

Type Parameters
Name Description
T

The target enum type.

| Improve this Doc View Source

ToEnum<T>(Int64)

Converts into enum of type T.

Declaration
public static T ToEnum<T>(this long value)

    where T : struct, Enum
Parameters
Type Name Description
Int64 value

The value to be converted.

Returns
Type Description
T

Enum value equals to the given value.

Type Parameters
Name Description
T

The target enum type.

| Improve this Doc View Source

ToEnum<T>(SByte)

Converts into enum of type T.

Declaration
public static T ToEnum<T>(this sbyte value)

    where T : struct, Enum
Parameters
Type Name Description
SByte value

The value to be converted.

Returns
Type Description
T

Enum value equals to the given value.

Type Parameters
Name Description
T

The target enum type.

| Improve this Doc View Source

ToEnum<T>(UInt16)

Converts into enum of type T.

Declaration
public static T ToEnum<T>(this ushort value)

    where T : struct, Enum
Parameters
Type Name Description
UInt16 value

The value to be converted.

Returns
Type Description
T

Enum value equals to the given value.

Type Parameters
Name Description
T

The target enum type.

| Improve this Doc View Source

ToEnum<T>(UInt32)

Converts into enum of type T.

Declaration
public static T ToEnum<T>(this uint value)

    where T : struct, Enum
Parameters
Type Name Description
UInt32 value

The value to be converted.

Returns
Type Description
T

Enum value equals to the given value.

Type Parameters
Name Description
T

The target enum type.

| Improve this Doc View Source

ToEnum<T>(UInt64)

Converts into enum of type T.

Declaration
public static T ToEnum<T>(this ulong value)

    where T : struct, Enum
Parameters
Type Name Description
UInt64 value

The value to be converted.

Returns
Type Description
T

Enum value equals to the given value.

Type Parameters
Name Description
T

The target enum type.

| Improve this Doc View Source

ToInt16<T>(T)

Converts enum value into primitive type .

Declaration
public static short ToInt16<T>(this T value)

    where T : struct, Enum
Parameters
Type Name Description
T value

Enum value to be converted.

Returns
Type Description
Int16

Enum value represented as .

Type Parameters
Name Description
T

Type of the enum value to be converted.

| Improve this Doc View Source

ToInt32<T>(T)

Converts enum value into primitive type .

Declaration
public static int ToInt32<T>(this T value)

    where T : struct, Enum
Parameters
Type Name Description
T value

Enum value to be converted.

Returns
Type Description
Int32

Enum value represented as .

Type Parameters
Name Description
T

Type of the enum value to be converted.

| Improve this Doc View Source

ToInt64<T>(T)

Converts enum value into primitive type .

Declaration
public static long ToInt64<T>(this T value)

    where T : struct, Enum
Parameters
Type Name Description
T value

Enum value to be converted.

Returns
Type Description
Int64

Enum value represented as .

Type Parameters
Name Description
T

Type of the enum value to be converted.

| Improve this Doc View Source

ToSByte<T>(T)

Converts enum value into primitive type .

Declaration
public static sbyte ToSByte<T>(this T value)

    where T : struct, Enum
Parameters
Type Name Description
T value

Enum value to be converted.

Returns
Type Description
SByte

Enum value represented as .

Type Parameters
Name Description
T

Type of the enum value to be converted.

| Improve this Doc View Source

ToUInt16<T>(T)

Converts enum value into primitive type .

Declaration
public static ushort ToUInt16<T>(this T value)

    where T : struct, Enum
Parameters
Type Name Description
T value

Enum value to be converted.

Returns
Type Description
UInt16

Enum value represented as .

Type Parameters
Name Description
T

Type of the enum value to be converted.

| Improve this Doc View Source

ToUInt32<T>(T)

Converts enum value into primitive type .

Declaration
public static uint ToUInt32<T>(this T value)

    where T : struct, Enum
Parameters
Type Name Description
T value

Enum value to be converted.

Returns
Type Description
UInt32

Enum value represented as .

Type Parameters
Name Description
T

Type of the enum value to be converted.

| Improve this Doc View Source

ToUInt64<T>(T)

Converts enum value into primitive type .

Declaration
public static ulong ToUInt64<T>(this T value)

    where T : struct, Enum
Parameters
Type Name Description
T value

Enum value to be converted.

Returns
Type Description
UInt64

Enum value represented as .

Type Parameters
Name Description
T

Type of the enum value to be converted.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX