System Namespace
Provides the base class for enumerations.
Visibility |
Name |
Parameters |
Return Type |
public |
CompareTo |
(
Object
target
)
|
Int32
|
public |
Equals |
(
Object
obj
)
|
Boolean
|
public static |
Format |
(
Type
enumType
,
Object
value
,
String
format
)
|
String
|
public |
GetHashCode |
( )
|
Int32
|
public static |
GetName |
(
Type
enumType
,
Object
value
)
|
String
|
public static |
GetNames |
(
Type
enumType
)
|
String
|
public |
GetTypeCode |
( )
|
TypeCode
|
public static |
GetUnderlyingType |
(
Type
enumType
)
|
Type
|
public static |
GetValues |
(
Type
enumType
)
|
Array
|
public |
HasFlag |
(
Enum
flag
)
|
Boolean
|
public static |
IsDefined |
(
Type
enumType
,
Object
value
)
|
Boolean
|
public static |
Parse |
(
Type
enumType
,
String
value
)
|
Object
|
public static |
Parse |
(
Type
enumType
,
String
value
,
Boolean
ignoreCase
)
|
Object
|
public static |
ToObject |
(
Type
enumType
,
SByte
value
)
|
Object
|
public static |
ToObject |
(
Type
enumType
,
Int32
value
)
|
Object
|
public static |
ToObject |
(
Type
enumType
,
Int16
value
)
|
Object
|
public static |
ToObject |
(
Type
enumType
,
Byte
value
)
|
Object
|
public static |
ToObject |
(
Type
enumType
,
Object
value
)
|
Object
|
public static |
ToObject |
(
Type
enumType
,
Int64
value
)
|
Object
|
public static |
ToObject |
(
Type
enumType
,
UInt64
value
)
|
Object
|
public static |
ToObject |
(
Type
enumType
,
UInt16
value
)
|
Object
|
public static |
ToObject |
(
Type
enumType
,
UInt32
value
)
|
Object
|
public |
ToString |
(
String
format
,
IFormatProvider
provider
)
|
String
|
public |
ToString |
( )
|
String
|
public |
ToString |
(
IFormatProvider
provider
)
|
String
|
public |
ToString |
(
String
format
)
|
String
|
public static |
TryParse |
(
String
value
,
TEnum&
result
)
|
Boolean
|
public static |
TryParse |
(
String
value
,
Boolean
ignoreCase
,
TEnum&
result
)
|
Boolean
|
|
An Enum is a named constant whose underlying type is any integral type except Char. If no underlying type is explicitly declared, Int32 is used. Enum derives from ValueType, but is not a value type. Programming languages typically provide syntax to declare an enumeration that consists of a set of named constants and their values.
Enum provides methods to compare instances of this class, convert the value of an instance to its string representation, convert the string representation of a number to an instance of this class, and create an instance of a specified enumeration and value.
You can also treat an Enum as a bit field. For more information, see FlagsAttribute.
This class inherits from ValueType, and implements the IComparable, IFormattable, and IConvertible interfaces. Use the Convert class for conversions instead of this class' explicit interface member implementation of IConvertible.
|
|