Click or drag to resize
EnumToObject Method (Type, Object)
Converts the specified object with an integer value to an enumeration member.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static Object ToObject(
	Type enumType,
	Object value
)

Parameters

enumType
Type: SystemType
The enumeration type to return.
value
Type: SystemObject
The value convert to an enumeration member.

Return Value

Type: Object
An enumeration object whose value is value.
Exceptions
ExceptionCondition
ArgumentNullExceptionenumType or value is null.
ArgumentExceptionenumType is not an Enum.-or- value is not type SByte, Int16, Int32, Int64, Byte, UInt16, UInt32, or UInt64.
See Also