Mono Class Library: System.Enum Overview | Members

System.Enum.ToObject Method

Returns an instance of the specified enumeration type set to the specified sbyte value.

[System.CLSCompliant(false)]
[System.Runtime.InteropServices.ComVisible(true)]
public static object ToObject (Type enumType, sbyte value)

Parameters

enumType
The Type of an enumeration.
value
The sbyte value to set.
value
Documentation for this section has not yet been entered.

Returns

An enumeration object of type enumType whose value is value.

Exceptions

TypeReason
ArgumentNullExceptionenumType is a null reference.
ArgumentExceptionenumType is not a Type that describes a Enum .

Remarks

This member is not CLS-compliant. For a CLS-compliant alternative, use Enum.ToObject(Type, object)(Type, short).

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0