asp.net.ph

Enum.ToObject Method ( Type, Object )

System Namespace   Enum Class


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

[ VB ]
<Serializable>
Overloads Public Shared Function ToObject ( _
   ByVal enumType As Type, _
   ByVal value As Object _
) As Object

[ C# ]
[Serializable]
public static object ToObject (
   Type enumType,
   object value
);

[ C++ ]
[Serializable]
public: static Object* ToObject (
   Type* enumType,
   Object* value
);

[JScript ]
public Serializable
static function ToObject (
   enumType : Type,
   value : Object
) : Object;

Parameters

enumType
An enumeration.
value
The value.

Return Value

An enumeration object whose value is value.

Exceptions


Exception Type Condition
ArgumentNullException enumType is a null reference ( Nothing in Visual Basic ).
ArgumentException enumType is not an Enum.

-or-

value is not type SByte, Int16, Int32, Int64, Byte, UInt16, UInt32, or UInt64.


Remarks

The value parameter is specified in terms of the underlying type of the enumeration.

See Also

Enum Members   Enum.ToObject Overload List Skip Navigation Links


Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note