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;
A new Object with the value of the string.
A new object that the string contents represent.
Exception Type | Condition |
---|---|
GetConvertFromException(System.Object) | The conversion could not be performed. |
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).
TypeConverter Class | TypeConverter Members | System.ComponentModel Namespace | TypeConverter.ConvertFromString Overload List | ITypeDescriptorContext