C# Класс EnumExtensions, code

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
From ( value ) : TEnum

Converts a into a through pointer cast. Does not throw if the sizes don't match, clips to smallest data-type instead. So if is smaller than bits that cannot be captured within 's size will be clipped.

FromName ( string desc ) : T

Find the enum from the description attribute.

GetAttribute ( Enum value ) : T
GetDescription ( value ) : string
GetDescriptions ( ) : string>.IDictionary
To ( value ) : TResult

Converts a into a through pointer cast. Does not throw if the sizes don't match, clips to smallest data-type instead. So if is smaller than bits that cannot be captured within 's size will be clipped.

ToName ( Enum value ) : string

Описание методов

From() публичный статический Метод

Converts a into a through pointer cast. Does not throw if the sizes don't match, clips to smallest data-type instead. So if is smaller than bits that cannot be captured within 's size will be clipped.
public static From ( value ) : TEnum
Результат TEnum

FromName() публичный статический Метод

Find the enum from the description attribute.
public static FromName ( string desc ) : T
desc string
Результат T

GetAttribute() публичный статический Метод

public static GetAttribute ( Enum value ) : T
value Enum
Результат T

GetDescription() публичный статический Метод

public static GetDescription ( value ) : string
Результат string

GetDescriptions() публичный статический Метод

public static GetDescriptions ( ) : string>.IDictionary
Результат string>.IDictionary

To() публичный статический Метод

Converts a into a through pointer cast. Does not throw if the sizes don't match, clips to smallest data-type instead. So if is smaller than bits that cannot be captured within 's size will be clipped.
public static To ( value ) : TResult
Результат TResult

ToName() публичный статический Метод

public static ToName ( Enum value ) : string
value Enum
Результат string