C# Class Schumix.Framework.CodeBureau.StringEnum

Helper class for working with 'extended' enums using StringValueAttribute attributes.
Datei anzeigen Open project: Schumix/Schumix2

Public Methods

Method Description
GetListValues ( ) : IList

Gets the values as a 'bindable' list datasource.

GetStringValue ( Enum value ) : string

Gets a string value for a particular enum value.

GetStringValue ( string valueName ) : string

Gets the string value associated with the given enum value.

GetStringValues ( ) : Array

Gets the string values associated with the enum.

IsStringDefined ( Type enumType, string stringValue ) : bool

Return the existence of the given string value within the enum.

IsStringDefined ( Type enumType, string stringValue, bool ignoreCase ) : bool

Return the existence of the given string value within the enum.

IsStringDefined ( string stringValue ) : bool

Return the existence of the given string value within the enum.

IsStringDefined ( string stringValue, bool ignoreCase ) : bool

Return the existence of the given string value within the enum.

Parse ( Type type, string stringValue ) : object

Parses the supplied enum and string value to find an associated enum value (case sensitive).

Parse ( Type type, string stringValue, bool ignoreCase ) : object

Parses the supplied enum and string value to find an associated enum value.

StringEnum ( Type enumType ) : System

Creates a new StringEnum instance.

Method Details

GetListValues() public method

Gets the values as a 'bindable' list datasource.
public GetListValues ( ) : IList
return IList

GetStringValue() public static method

Gets a string value for a particular enum value.
public static GetStringValue ( Enum value ) : string
value System.Enum Value.
return string

GetStringValue() public method

Gets the string value associated with the given enum value.
public GetStringValue ( string valueName ) : string
valueName string Name of the enum value.
return string

GetStringValues() public method

Gets the string values associated with the enum.
public GetStringValues ( ) : Array
return System.Array

IsStringDefined() public static method

Return the existence of the given string value within the enum.
public static IsStringDefined ( Type enumType, string stringValue ) : bool
enumType System.Type Type of enum
stringValue string String value.
return bool

IsStringDefined() public static method

Return the existence of the given string value within the enum.
public static IsStringDefined ( Type enumType, string stringValue, bool ignoreCase ) : bool
enumType System.Type Type of enum
stringValue string String value.
ignoreCase bool Denotes whether to conduct a case-insensitive match on the supplied string value
return bool

IsStringDefined() public method

Return the existence of the given string value within the enum.
public IsStringDefined ( string stringValue ) : bool
stringValue string String value.
return bool

IsStringDefined() public method

Return the existence of the given string value within the enum.
public IsStringDefined ( string stringValue, bool ignoreCase ) : bool
stringValue string String value.
ignoreCase bool Denotes whether to conduct a case-insensitive match on the supplied string value
return bool

Parse() public static method

Parses the supplied enum and string value to find an associated enum value (case sensitive).
public static Parse ( Type type, string stringValue ) : object
type System.Type Type.
stringValue string String value.
return object

Parse() public static method

Parses the supplied enum and string value to find an associated enum value.
public static Parse ( Type type, string stringValue, bool ignoreCase ) : object
type System.Type Type.
stringValue string String value.
ignoreCase bool Denotes whether to conduct a case-insensitive match on the supplied string value
return object

StringEnum() public method

Creates a new StringEnum instance.
public StringEnum ( Type enumType ) : System
enumType System.Type Enum type.
return System