BCL mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.5000.0 2.0.0.0 4.0.0.0 System.ValueType System.IComparable System.IConvertible System.IFormattable System.Runtime.InteropServices.ComVisible(true)

An enumeration is a set of named constants whose underlying type is any integral type. If no underlying type is explicitly declared, is used. is the base class for all enumerations in the .NET Framework.

provides methods for comparing instances of this class, converting the value of an instance to its string representation, converting the string representation of a number to an instance of this class, and creating an instance of a specified enumeration and value.

You can also treat an enumeration as a bit field. For more information, see the Non-Exclusive Members and the Flags Attribute section and the topic.

## Creating an Enumeration Type

Programming languages typically provide syntax to declare an enumeration that consists of a set of named constants and their values. The following example illustrates the syntax used by C# and Visual Basic to define an enumeration. It creates an enumeration named ArrivalStatus that has three members: ArrivalStatus.Early, ArrivalStatus.OnTime, and ArrivalStatus.Late. Note that in both cases, the enumeration does not explicitly inherit from ; the inheritance relationship is handled implicitly by the compiler.

code reference: System.Enum.Class#1

You should never create an enumeration type whose underlying type is non-integral or . Although you can create such an enumeration type by using reflection, method calls that use the resulting type are unreliable and may also throw additional exceptions.

## Instantiating an Enumeration Type

You can instantiate an enumeration type just as you instantiate any other value type: by declaring a variable and assigning one of the enumeration's constants to it. The following example instantiates an ArrivalStatus whose value is ArrivalStatus.OnTime.

code reference: System.Enum.Class#2

You can also instantiate an enumeration value in the following ways:

By using a particular programming language's features to cast (as in C#) or convert (as in Visual Basic) an integer value to an enumeration value. The following example creates an ArrivalStatus object whose value is ArrivalStatus.Early in this way.

code reference: System.Enum.Class#4

By calling its implicit default constructor. As the following example shows, in this case the underlying value of the enumeration instance is 0. However, this is not necessarily the value of a valid constant in the enumeration.

code reference: System.Enum.Class#3

By calling the or method to parse a string that contains the name of a constant in the enumeration. For more information, see the Parsing Enumeration Values section.

By calling the method to convert an integral value to an enumeration type. For more information, see the Performing Conversions section.

## Enumeration Best Practices

We recommend that you use the following best practices when you define enumeration types:

If you have not defined an enumeration member whose value is 0, consider creating a None enumerated constant. By default, the memory used for the enumeration is initialized to zero by the common language runtime. Consequently, if you do not define a constant whose value is zero, the enumeration will contain an illegal value when it is created.

If there is an obvious default case that your application has to represent, consider using an enumerated constant whose value is zero to represent it. If there is no default case, consider using an enumerated constant whose value is zero to specify the case that is not represented by any of the other enumerated constants.

Do not specify enumerated constants that are reserved for future use.

When you define a method or property that takes an enumerated constant as a value, consider validating the value. The reason is that you can cast a numeric value to the enumeration type even if that numeric value is not defined in the enumeration.

Additional best practices for enumeration types whose constants are bit fields are listed in the Non-Exclusive Members and the Flags Attribute section.

## Performing Operations with Enumerations

You cannot define new methods when you are creating an enumeration. However, an enumeration type inherits a complete set of static and instance methods from the class. The following sections survey most of these methods, in addition to several other methods that are commonly used when working with enumeration values.

## Performing Conversions

You can convert between an enumeration member and its underlying type by using a casting (in C#) or conversion (in Visual Basic) operator. The following example uses casting or conversion operators to perform conversions both from an integer to an enumeration value and from an enumeration value to an integer.

code reference: System.Enum.Class#5

The class also includes a method that converts a value of any integral type to an enumeration value. The following example uses the method to convert an to an ArrivalStatus value. Note that, because the returns a value of type , the use of a casting or conversion operator may still be necessary to cast the object to the enumeration type.

code reference: System.Enum.Class#6

When converting an integer to an enumeration value, it is possible to assign a value that is not actually a member of the enumeration. To prevent this, you can pass the integer to the method before performing the conversion. The following example uses this method to determine whether the elements in an array of integer values can be converted to ArrivalStatus values.

code reference: System.Enum.Class#7

Although the class provides explicit interface implementations of the interface for converting from an enumeration value to an integral type, you should use the methods of the class, such as , to perform these conversions. The following example illustrates how you can use the method along with the method to convert an enumeration value to its underlying type. Note that this example does not require the underlying type of the enumeration to be known at compile time.

code reference: System.Enum.Class#8

## Parsing Enumeration Values

The and methods allow you to convert the string representation of an enumeration value to that value. The string representation can be either the name or the underlying value of an enumeration constant. Note that the parsing methods will successfully convert string representations of numbers that are not members of a particular enumeration if the strings can be converted to a value of the enumeration's underlying type. To prevent this, the method can be called to ensure that the result of the parsing method is a valid enumeration value. The example illustrates this approach and demonstrates calls to both the and methods. Note that the non-generic parsing method returns an object that you may have to cast (in C#) or convert (in Visual Basic) to the appropriate enumeration type.

code reference: System.Enum.Class#9

## Formatting Enumeration Values

You can convert enumeration values to their string representations by calling the static method, as well as the overloads of the instance method. You can use a format string to control the precise way in which an enumeration value is represented as a string. For more information, see Enumeration Format Strings. The following example uses each of the supported enumeration format strings to convert a member of the ArrivalStatus enumeration to its string representations.

code reference: System.Enum.Class#10

## Iterating Enumeration Members

The type does not implement the or interface, which would enable you to iterate members of a collection by using a foreach (in C#) or For Each (in Visual Basic) construct. However, you can enumerate members in either of two ways.

You can call the method to retrieve a string array containing the names of the enumeration members. Next, for each element of the string array, you can call the method to convert the string to its equivalent enumeration value. The following example illustrates this approach.

code reference: System.Enum.Class#11

You can call the method to retrieve an array that contains the underlying values in the enumeration. Next, for each element of the array, you can call the method to convert the integer to its equivalent enumeration value. The following example illustrates this approach.

code reference: System.Enum.Class#12

## Non-Exclusive Members and the Flags Attribute

One common use of an enumeration is to represent a set of mutually exclusive values. For example, an ArrivalStatus instance can have a value of Early, OnTime, or Late. It makes no sense for the value of an ArrivalStatus instance to reflect more than one enumeration constant.

In other cases, however, the value of an enumeration object can include multiple enumeration members, and each member represents a bit field in the enumeration value. The attribute can be used to indicate that the enumeration consists of bit fields. For example, an enumeration named Pets might be used to indicate the kinds of pets in a household. It can be defined as follows.

code reference: System.Enum.Class#13

The Pets enumeration can then be used as shown in the following example.

code reference: System.Enum.Class#14

The following best practices should be used when defining a bitwise enumeration and applying the attribute.

Use the custom attribute for an enumeration only if a bitwise operation (AND, OR, EXCLUSIVE OR) is to be performed on a numeric value.

Define enumeration constants in powers of two, that is, 1, 2, 4, 8, and so on. This means the individual flags in combined enumeration constants do not overlap.

Consider creating an enumerated constant for commonly used flag combinations. For example, if you have an enumeration used for file I/O operations that contains the enumerated constants Read = 1 and Write = 2, consider creating the enumerated constant ReadWrite = Read OR Write, which combines the Read and Write flags. In addition, the bitwise OR operation used to combine the flags might be considered an advanced concept in some circumstances that should not be required for simple tasks.

Use caution if you define a negative number as a flag enumerated constant because many flag positions might be set to 1, which might make your code confusing and encourage coding errors.

A convenient way to test whether a flag is set in a numeric value is to call the instance method, as shown in the following example.

code reference: System.Enum.Class#15

It is equivalent to performing a bitwise AND operation between the numeric value and the flag enumerated constant, which sets all bits in the numeric value to zero that do not correspond to the flag, and then testing whether the result of that operation is equal to the flag enumerated constant. This is illustrated in the following example.

code reference: System.Enum.Class#16

Use None as the name of the flag enumerated constant whose value is zero. You cannot use the None enumerated constant in a bitwise AND operation to test for a flag because the result is always zero. However, you can perform a logical, not a bitwise, comparison between the numeric value and the None enumerated constant to determine whether any bits in the numeric value are set. This is illustrated in the following example.

code reference: System.Enum.Class#17

Do not define an enumeration value solely to mirror the state of the enumeration itself. For example, do not define an enumerated constant that merely marks the end of the enumeration. If you need to determine the last value of the enumeration, check for that value explicitly. In addition, you can perform a range check for the first and last enumerated constant if all values within the range are valid.

Provides the base class for enumerations.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  To be added.

  Initializes a new instance of the class.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  This method is implemented to support the interface.

  and the current instance are not of the same enumeration type.

  Compares this instance to a specified object and returns an indication of their relative values.

  A signed number that indicates the relative values of this instance and .

  Value

  Meaning

  Less than zero

  The value of this instance is less than the value of .

  Zero

  The value of this instance is equal to the value of .

  Greater than zero

  The value of this instance is greater than the value of .

  -or-

  is null.

  An object to compare, or null. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` An object to compare with this instance, or null.

  The method overrides to define how enumeration members are evaluated for equality.

  Returns a value indicating whether this instance is equal to a specified object.

  true if is an enumeration value of the same type and with the same underlying value as this instance; otherwise, false.

  An object to compare with this instance, or null. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(true)
  System.String `` `` `` , or is a null reference.

  is not a .

  -or-

  is neither of type nor does it have the same underlying type as .

  contains an invalid value.

  The following example demonstrates formatting enumeration values.

  `using System; public enum Signs { Stop = 1, Yield = 2, Merge = 4 }; [Flags] public enum Lights { Red = 1, Yellow = 2, Green = 4 }; public class EnumCompTo { public static void Main() { Console.WriteLine(Signs.Format(typeof(Signs), Signs.Merge, "d")); Console.WriteLine(Signs.Format(typeof(Signs), 7, "g")); Console.WriteLine(Lights.Format(typeof(Lights), Lights.Yellow, "x")); Console.WriteLine(Lights.Format(typeof(Lights), 7, "g")); } }`

  The output is

  4

  7

  00000002

  Red, Yellow, Green

  The value to convert. The output format to use.

  The following table shows the valid values for the parameter.

  Format

  Description

  "G" or "g"

  If is equal to a named enumerated constant, the name of that constant is returned; otherwise, the decimal equivalent of is returned.

  For example, suppose the only enumerated constant is named Red, and its value is 1. If is specified as 1, this format returns "Red". However, if is specified as 2, this format returns "2".

  -or-

  If the custom attribute is applied to the enumeration, is treated as a bit field that contains one or more flags that consist of one or more bits.

  If is equal to a combination of named enumerated constants, a delimiter-separated list of the names of those constants is returned. is searched for flags, going from the flag with the largest value to the smallest value. For each flag that corresponds to a bit field in , the name of the constant is concatenated to the delimiter-separated list. The value of that flag is then excluded from further consideration, and the search continues for the next flag.

  If is not equal to a combination of named enumerated constants, the decimal equivalent of is returned.

  "X" or "x"

  Represents in hexadecimal format without a leading "0x".

  "D" or "d"

  Represents in decimal form.

  "F" or "f"

  Behaves identically to "G" or "g", except that the is not required to be present on the declaration.

  Converts the specified value of a specified enumerated type to its equivalent string representation according to the specified format.

  A string representation of .

  The enumeration type of the value to convert. The value to convert. The output format to use. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32

  The algorithm used to generate the hash code is unspecified.

  This method overrides .

  Returns the hash code for the value of this instance.

  A 32-bit signed integer hash code.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(true)
  System.String `` `` or is a null reference.

  is not a that describes a .

  -or-

  is neither of type nor does it have the same underlying type as .

  The following example demonstrates the method.

  `using System; public enum Signs { Stop = 1, Yield = 2, Merge = 4 }; public class EnumCompTo { public static void Main() { Console.Write( "The name of the constant with the value 4 is: " ); Console.WriteLine( "{0}.", Signs.GetName(typeof(Signs), 4)); Console.Write( "The name of the constant with the value Stop is: " ); Console.WriteLine( "{0}.", Signs.GetName(typeof(Signs), Signs.Stop )); } }`

  The output is

  The name of the constant with the value 4 is: Merge.

  The name of the constant with the value Stop is: Stop.

  If multiple enumeration members have the same underlying value, the method guarantees that it will return the name of one of those enumeration members. However, it does not guarantee that it will always return the name of the same enumeration member. As a result, when multiple enumeration members have the same value, your application code should never depend on the method returning a particular member's name.

  Retrieves the name of the constant in the specified enumeration that has the specified value.

  A string containing the name of the enumerated constant in whose value is ; or null if no such constant is found.

  An enumeration type. The value of a particular enumerated constant in terms of its underlying type. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(true)
  System.String[] `` is a null reference.

  is not a that describes a .

  The following example demonstrates the method.

  `using System; public enum Colors { Red, White, Blue }; public class enumGetNames { public static void Main() { int i = 0; String[] strAry = Colors.GetNames( typeof(Colors) ); foreach (String str in strAry) { Console.Write("The value indexed '{0}' ", i++ ); Console.WriteLine("is {0}.", str); } } }`

  The output is

  The value indexed '0' is Red.

  The value indexed '1' is White.

  The value indexed '2' is Blue.

  The elements of the return value array are sorted by the binary values of the enumerated constants (that is, by their unsigned magnitude). The following example provides displays information about the array returned by the method for an enumeration that includes a negative, zero, and positive value.

  code reference: System.Enum.GetNames#1

  If there are enumerated constants with same value, the order of their corresponding names is unspecified.

  Retrieves an array of the names of the constants in a specified enumeration.

  A string array of the names of the constants in .

  An enumeration type. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.TypeCode To be added.

  Returns the underlying for this instance.

  The type for this instance.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(true)
  System.Type `` is a null reference.

  is not an enumeration type.

  The following example demonstrates the method.

  `using System; public enum Colors { Red, White, Blue } public class EnumUnderlyingTypeTest { public static void Main() { Type t = Colors.GetUnderlyingType( typeof(Colors) ); Console.WriteLine("The underlying type of Colors is {0}.", t.ToString()); } }`

  The output is

  The underlying type of Colors is System.Int32.

  The structure enables values to be represented as named constants. The data type of the enumeration's values is known as its underlying type. For example, the underlying type of the enumeration, which consists of constants that represent each day of the week (, , and so on), is .

  Returns the underlying type of the specified enumeration.

  The underlying type of .

  The enumeration whose underlying type will be retrieved. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(true)
  System.Array `` is a null reference.

  is not an enumeration type.

  The following example demonstrates the method.

  `using System; public enum Colors { Red = 1, White = 2, Blue = 4 } public class enumGetValues { public static void Main() { Array valueAry = Enum.GetValues(typeof(Colors)); foreach (int i in valueAry) { Console.WriteLine("The value of element {0} is {1}", Enum.Format(typeof(Colors), i, "g"),i); } } }`

  The output is

  The value of element Red is 1.

  The value of element White is 2.

  The value of element Blue is 4.

  The elements of the array are sorted by the binary values of the enumeration constants (that is, by their unsigned magnitude). The following example displays information about the array returned by the method for an enumeration that includes a negative value, zero, and a positive value.

  code reference: System.Enum.GetValues#1

  The method returns an array that contains a value for each member of the enumeration. If multiple members have the same value, the returned array includes duplicate values. In this case, calling the method with each value in the returned array does not restore the unique names assigned to members that have duplicate values. To retrieve all the names of enumeration members successfully, call the method.

  The method cannot be invoked by using reflection in a reflection-only context. Instead, you can retrieve the value of all enumeration members by using the method to get an array of objects that represent enumeration members and then call the method on each element of the array. The following example illustrates this technique. It requires that you define the following enumeration in an assembly named Enumerations.dll:

  code reference: System.Enum.GetValues#2

  The assembly is loaded in a reflection-only context, a object that represents the Pets enumeration is instantiated, an array of objects is retrieved, and the field values are displayed to the console.

  code reference: System.Enum.GetValues#3

  Retrieves an array of the values of the constants in a specified enumeration.

  An array that contains the values of the constants in .

  An enumeration type. 0
- Method
  4.0.0.0
  System.Boolean ``

  The method returns the result of the following Boolean expression.

  `thisInstance And flag = flag`

  If the underlying value of is zero, the method returns true. If this behavior is not desirable, you can use the method to test for equality with zero and call only if the underlying value of is non-zero, as the following example illustrates.

  code reference: System.Enum.HasFlag#1

  The method is designed to be used with enumeration types that are marked with the attribute and can be used to determine whether multiple bit fields are set. For enumeration types that are not marked with the attribute, call either the method or the method.

  Determines whether one or more bit fields are set in the current instance.

  true if the bit field or bit fields that are set in are also set in the current instance; otherwise, false.

  An enumeration value.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(true)
  System.Boolean `` `` or is a null reference.

  is not an enumeration type.

  -or-

  The type of is not an or an underlying type of .

  The following example demonstrates the method.

  `using System; public enum Colors { Red = 1, White = 2, Blue = 4 } public class enumIsDefined { public static void Main() { Console.Write("It is {0} ", Enum.IsDefined(typeof(Colors), 1)); Console.WriteLine("that '1' is defined in 'Colors'."); Console.Write("It is {0} ", Enum.IsDefined(typeof(Colors), 3)); Console.WriteLine("that '3' is defined in 'Colors'."); } }`

  The output is

  It is True that '1' is defined in 'Colors'.

  It is False that '3' is defined in 'Colors'.

  The value or name of a constant in .

  The parameter can be any of the following:

  Any member of type .

  A variable whose value is an enumeration member of type .

  The string representation of the name of an enumeration member. The characters in the string must have the same case as the enumeration member name.

  A value of the underlying type of .

  If the constants in define a set of bit fields and contains the values, names, or underlying values of multiple bit fields, the method returns false. In other words, for enumerations that define a set of bit fields, the method determines only whether a single bit field belongs to the enumeration. To determine whether multiple bit fields are set in an enumeration type that is tagged with the attribute, you can call the method.

  Returns an indication whether a constant with a specified value exists in a specified enumeration.

  true if a constant in has a value equal to ; otherwise, false.

  An enumeration type. The value or name of a constant in . 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(true)
  System.Object `` `` or is a null reference.

  is not a that describes a .

  -or-

  is either equal to or contains only white space.

  -or-

  represents one or more names, and at least one name represented by is not of type .

  The following example demonstrates the method.

  `using System; public enum Colors { Red = 1, Blue = 2 } public class enumTest { public static void Main() { object o = Enum.Parse( typeof (Colors), "Red, Blue"); Type oType = o.GetType(); Console.WriteLine("The type of the object returned is {0}",oType.ToString()); Array values = Enum.GetValues(oType); foreach (Colors c in values) { Console.WriteLine(Enum.Format(oType,c,"D")); } } }`

  The output is

  The type of the object returned is Colors

  1

  2

  A string containing the name or value to convert.

  The parameter contains the string representation of an enumeration member's underlying value or named constant, or a list of named constants delimited by commas (,). One or more blank spaces can precede or follow each value, name, or comma in . If is a list, the return value is the value of the specified names combined with a bitwise OR operation.

  If is a name that does not correspond to a named constant of , the method throws an . If is the string representation of an integer that does not represent an underlying value of the enumeration, the method returns an enumeration member whose underlying value is converted to an integral type. If this behavior is undesirable, call the method to ensure that a particular string representation of an integer is actually a member of . The following example defines a Colors enumeration, calls the method to convert strings to their corresponding enumeration values, and calls the method to ensure that particular integral values are underlying values in the Colors enumeration.

  code reference: System.Enum.Parse#1

  This operation is case-sensitive.

  Converts the string representation of the name or numeric value of one or more enumerated constants to an equivalent enumerated object.

  An object of type whose value is represented by .

  An enumeration type. A string containing the name or value to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(true)
  System.Object `` `` `` or is a null reference.

  is not a that describes a .

  -or-

  is either equal to or contains only white space.

  -or-

  represents one or more names, and at least one name represented by is not of type .

  For an example that demonstrates parsing strings containing enumeration values, see (, ).

  true to ignore case; false to regard case.

  The parameter contains the string representation of an enumeration member's underlying value or named constant, or a list of named constants delimited by commas (,). One or more blank spaces can precede or follow each value, name, or comma in . If is a list, the return value is the value of the specified names combined with a bitwise OR operation.

  If is a name that does not correspond to a named constant of , the method throws an . If is the string representation of an integer that does not represent an underlying value of the enumeration, the method returns an enumeration member whose underlying value is converted to an integral type. If this behavior is undesirable, call the method to ensure that a particular string representation of an integer is actually a member of . The following example defines a Colors enumeration, calls the method to convert strings to their corresponding enumeration values, and calls the method to ensure that particular integral values are underlying values in the Colors enumeration.

  code reference: System.Enum.Parse#2

  The parameter specifies whether this operation is case-sensitive.

  Converts the string representation of the name or numeric value of one or more enumerated constants to an equivalent enumerated object. A parameter specifies whether the operation is case-insensitive.

  An object of type whose value is represented by .

  An enumeration type. A string containing the name or value to convert. true to ignore case; false to regard case. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  Currently not implemented. Always throws an exception.

  Converts the current value to a Boolean value based on the underlying type.

  This member always throws an exception.

  An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte ``

  Uses to perform the conversion.

  Converts the current value to an 8-bit unsigned integer based on the underlying type.

  The converted value.

  An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char ``

  Currently not implemented. Always throws an exception.

  Converts the current value to a Unicode character based on the underlying type.

  This member always throws an exception.

  An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime ``

  Currently not implemented. Always throws an exception.

  Converts the current value to a based on the underlying type.

  This member always throws an exception.

  An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal ``

  Currently not implemented. Always throws an exception.

  Converts the current value to a based on the underlying type.

  This member always throws an exception.

  An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Double ``

  Currently not implemented. Always throws an exception.

  Converts the current value to a double-precision floating point number based on the underlying type.

  This member always throws an exception.

  An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int16 ``

  Uses to perform the conversion.

  Converts the current value to a 16-bit signed integer based on the underlying type.

  The converted value.

  An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  Uses to perform the conversion.

  Converts the current value to a 32-bit signed integer based on the underlying type.

  The converted value.

  An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 ``

  Uses to perform the conversion.

  Converts the current value to a 64-bit signed integer based on the underlying type.

  The converted value.

  An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.SByte ``

  Uses to perform the conversion.

  Converts the current value to an 8-bit signed integer based on the underlying type.

  The converted value.

  An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Single ``

  Currently not implemented. Always throws an exception.

  Converts the current value to a single-precision floating-point number based on the underlying type.

  This member always throws an exception.

  An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Object `` `` To be added.

  Uses to perform the conversion.

  Converts the current value to a specified type based on the underlying type.

  The converted value.

  An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.UInt16 ``

  Uses to perform the conversion.

  Converts the current value to a 16-bit unsigned integer based on the underlying type.

  The converted value.

  An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.UInt32 ``

  Uses to perform the conversion.

  Converts the current value to a 32-bit unsigned integer based on the underlying type.

  The converted value.

  An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.UInt64 ``

  Uses to perform the conversion.

  Converts the current value to a 64-bit unsigned integer based on the underlying type.

  The converted value.

  An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(true)
  System.Object `` `` is a null reference.

  is not a that describes a .

  The value to convert to an enumeration member.

  The method converts to an enumeration member whose underlying value is . Note that the conversion succeeds even if value is outside the bounds of members. To ensure that is a valid underlying value of the enumeration, pass it to the method.

  This conversion method returns a value of type . You can then cast it or convert it to an object of type .

  Converts the specified 8-bit unsigned integer to an enumeration member.

  An instance of the enumeration set to .

  The enumeration type to return. The value to convert to an enumeration member. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(true)
  System.Object `` `` is a null reference.

  is not a that describes a .

  The value to convert to an enumeration member.

  The method converts to an enumeration member whose underlying value is . Note that the conversion succeeds even if value is outside the bounds of members. To ensure that is a valid underlying value of the enumeration, pass it to the method.

  This conversion method returns a value of type . You can then cast it or convert it to an object of type .

  Converts the specified 16-bit signed integer to an enumeration member.

  An instance of the enumeration set to .

  The enumeration type to return. The value to convert to an enumeration member. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(true)
  System.Object `` `` is a null reference.

  is not a that describes a .

  The value to convert to an enumeration member.

  The method converts to an enumeration member whose underlying value is . Note that the conversion succeeds even if value is outside the bounds of members. To ensure that is a valid underlying value of the enumeration, pass it to the method.

  This conversion method returns a value of type . You can then cast it or convert it to an object of type .

  Converts the specified 32-bit signed integer to an enumeration member.

  An instance of the enumeration set to .

  The enumeration type to return. The value to convert to an enumeration member. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(true)
  System.Object `` `` is a null reference.

  is not a that describes a .

  The value to convert to an enumeration member.

  The method converts to an enumeration member whose underlying value is . Note that the conversion succeeds even if value is outside the bounds of members. To ensure that is a valid underlying value of the enumeration, pass it to the method.

  This conversion method returns a value of type . You can then cast it or convert it to an object of type .

  Converts the specified 64-bit signed integer to an enumeration member.

  An instance of the enumeration set to .

  The enumeration type to return. The value to convert to an enumeration member. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(true)
  System.Object `` `` is a null reference.

  is not a that describes a .

  The value convert to an enumeration member.

  The method converts the integral value to an enumeration member whose underlying value is . Note that the conversion succeeds even if value is outside the bounds of members. To ensure that is a valid underlying value of the enumeration, pass it to the method.

  This conversion method returns a value of type . You can then cast it or convert it to an object of type .

  Converts the specified object with an integer value to an enumeration member.

  An enumeration object whose value is .

  The enumeration type to return. The value convert to an enumeration member. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Runtime.InteropServices.ComVisible(true)
  System.Object `` `` is a null reference.

  is not a that describes a .

  The value to convert to an enumeration member.

  The method converts to an enumeration member whose underlying value is . Note that the conversion succeeds even if value is outside the bounds of members. To ensure that is a valid underlying value of the enumeration, pass it to the method.

  This conversion method returns a value of type . You can then cast it or convert it to an object of type .

  Converts the specified 8-bit signed integer value to an enumeration member.

  An instance of the enumeration set to .

  The enumeration type to return. The value to convert to an enumeration member. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Runtime.InteropServices.ComVisible(true)
  System.Object `` `` is a null reference.

  is not a that describes a .

  The value to convert to an enumeration member.

  The method converts to an enumeration member whose underlying value is . Note that the conversion succeeds even if value is outside the bounds of members. To ensure that is a valid underlying value of the enumeration, pass it to the method.

  This conversion method returns a value of type . You can then cast it or convert it to an object of type .

  Converts the specified 16-bit unsigned integer value to an enumeration member.

  An instance of the enumeration set to .

  The enumeration type to return. The value to convert to an enumeration member. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Runtime.InteropServices.ComVisible(true)
  System.Object `` `` is a null reference.

  is not a that describes a .

  The value to convert to an enumeration member.

  The method converts to an enumeration member whose underlying value is . Note that the conversion succeeds even if value is outside the bounds of members. To ensure that is a valid underlying value of the enumeration, pass it to the method.

  This conversion method returns a value of type . You can then cast it or convert it to an object of type .

  Converts the specified 32-bit unsigned integer value to an enumeration member.

  An instance of the enumeration set to .

  The enumeration type to return. The value to convert to an enumeration member. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Runtime.InteropServices.ComVisible(true)
  System.Object `` `` is a null reference.

  is not a that describes a .

  The value to convert to an enumeration member.

  The method converts to an enumeration member whose underlying value is . Note that the conversion succeeds even if value is outside the bounds of members. To ensure that is a valid underlying value of the enumeration, pass it to the method.

  This conversion method returns a value of type . You can then cast it or convert it to an object of type .

  Converts the specified 64-bit unsigned integer value to an enumeration member.

  An instance of the enumeration set to .

  The enumeration type to return. The value to convert to an enumeration member. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String

  The return value is formatted with the general format specifier ("G"). That is, if the is not applied to this enumerated type and there is a named constant equal to the value of this instance, then the return value is a string containing the name of the constant. If the is applied and there is a combination of one or more named constants equal to the value of this instance, then the return value is a string containing a delimiter-separated list of the names of the constants. Otherwise, the return value is the string representation of the numeric value of this instance. For more information about formatting enumeration values, see Enumeration Format Strings. For more information about formatting in general, see Formatting Types.

  Converts the value of this instance to its equivalent string representation.

  The string representation of the value of this instance.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Obsolete("Provider is ignored, just use ToString")
  System.String ``

  This method is equivalent to the version of that takes no arguments.

  This method overload is obsolete; use .

  The string representation of the value of this instance.

  (obsolete) 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` contains an invalid value.

  The parameter can contain the "G" or "g", "D" or "d", "X" or "x", and "F" or "f" format strings. If is null or an empty string (""), the general format specifier ("G") is used. For more information about formatting enumeration values, see Enumeration Format Strings. For more information about formatting in general, see Formatting Types.

  Converts the value of this instance to its equivalent string representation using the specified format.

  The string representation of the value of this instance as specified by .

  A format string. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Obsolete("Provider is ignored, just use ToString")
  System.String `` `` does not contain a valid format specifier. A format specification. (Obsolete.)

  Specify only ; the parameter is obsolete.

  This method overload is obsolete; use .

  The string representation of the value of this instance as specified by .

  A format specification. (Obsolete.) 0
- Method
  4.0.0.0
  System.Boolean DefaultConstructorConstraint NotNullableValueTypeConstraint System.ValueType `` `` To be added. To be added. To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.Boolean DefaultConstructorConstraint NotNullableValueTypeConstraint System.ValueType `` `` `` To be added. To be added. To be added. To be added. To be added. To be added. To be added.
0