Enum::ToObject Method (Type, Object)
Converts the specified object with an integer value to an enumeration member.
Assembly: mscorlib (in mscorlib.dll)
[ComVisibleAttribute(true)] public: static Object^ ToObject( Type^ enumType, Object^ value )
Parameters
- enumType
- Type: System::Type
The enumeration type to return.
- value
- Type: System::Object
The value convert to an enumeration member.
The ToObject(Type, Object) method converts the integral value value to an enumeration member whose underlying value is value. Note that the conversion succeeds even if value is outside the bounds of enumType members. To ensure that value is a valid underlying value of the enumType enumeration, pass it to the IsDefined method.
This conversion method returns a value of type Object. You can then cast it or convert it to an object of type enumType.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.