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, Boolean)

Converts a string to an enumerated value.

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

Parameters

enumType
The enumeration in which to search for the string.
value
[To be supplied.]
ignoreCase
[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. Case sensitive by default, but if ignoreCase is true, this accepts strings of the form "green" as well.

See Also

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