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!

TypeConverter.ConvertFromString (ITypeDescriptorContext, String)

Converts the specified text into an object.

[Visual Basic]
Overloads Public Function ConvertFromString( _
   ByVal context As ITypeDescriptorContext, _
   ByVal text As String _
) As Object
[C#]
public object ConvertFromString(
   ITypeDescriptorContext context,
   string text
);
[C++]
public: Object* ConvertFromString(
   ITypeDescriptorContext* context,
   String* text
);
[JScript]
public function ConvertFromString(
   context : ITypeDescriptorContext,
   text : String
) : Object;

Parameters

context
An ITypeDescriptorContext that represents a context for the formatter.
text
The text representation of the object to convert.

Return Value

A new Object with the value of the string.

A new object that the string contents represent.

Exceptions

Exception Type Condition
GetConvertFromException(System.Object) The conversion could not be performed.

Remarks

An exception will be raised if the string cannot be converted into the appropriate object. The default implementation always returns null.

The context can be used to extract additional information about the environment this converter is being invoked from. This may be a null reference (in Visual Basic Nothing), so you should always check. Also, properties on the context object may also return a null reference (Nothing).

See Also

TypeConverter Class | TypeConverter Members | System.ComponentModel Namespace | TypeConverter.ConvertFromString Overload List | ITypeDescriptorContext