C# Class EnumExtensions, code

Afficher le fichier Open project: shendongnian/code Class Usage Examples

Méthodes publiques

Méthode Description
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

Method Details

From() public static méthode

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
Résultat TEnum

FromName() public static méthode

Find the enum from the description attribute.
public static FromName ( string desc ) : T
desc string
Résultat T

GetAttribute() public static méthode

public static GetAttribute ( Enum value ) : T
value Enum
Résultat T

GetDescription() public static méthode

public static GetDescription ( value ) : string
Résultat string

GetDescriptions() public static méthode

public static GetDescriptions ( ) : string>.IDictionary
Résultat string>.IDictionary

To() public static méthode

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
Résultat TResult

ToName() public static méthode

public static ToName ( Enum value ) : string
value Enum
Résultat string