NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Enum.FromString (Type, String)

Converts a string to an enumerated value.

[Visual Basic]
Overloads Public Shared Function FromString( _
   ByVal enumType As Type, _
   ByVal value As String _
) As Object
[C#]
public static object FromString(
   Type enumType,
   string value
);
[C++]
public: static Object* FromString(
   Type* enumType,
   String* value
);
[JScript]
public static function FromString(
   enumType : Type,
   value : String
) : Object;

Parameters

enumType
The enumeration in which to search for the string.
value
[To be supplied.]

Return Value

The enumerated value as an object.

Exceptions

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

The string does not correspond to a valid value of the enumeration.

Remarks

Given the string representation of an enumerated name (ie "Red", "Green | Blue"), or value ("1", "12") returns the enumerated value as an object. This version of the call is case sensitive.

See Also

Enum Class | Enum Members | System Namespace | Enum.FromString Overload List