แก้ไข

แชร์ผ่าน


TypeConverter.ConvertFromInvariantString Method

Definition

Converts the value to a type of this converter, using the invariant culture.

Overloads

ConvertFromInvariantString(String)

Converts the given string to the type of this converter, using the invariant culture.

ConvertFromInvariantString(ITypeDescriptorContext, String)

Converts the given string to the type of this converter, using the invariant culture and the specified context.

ConvertFromInvariantString(String)

Source:
TypeConverter.cs
Source:
TypeConverter.cs
Source:
TypeConverter.cs

Converts the given string to the type of this converter, using the invariant culture.

public:
 System::Object ^ ConvertFromInvariantString(System::String ^ text);
public object ConvertFromInvariantString (string text);
public object? ConvertFromInvariantString (string text);
member this.ConvertFromInvariantString : string -> obj
Public Function ConvertFromInvariantString (text As String) As Object

Parameters

text
String

The String to convert.

Returns

An Object that represents the converted text.

Exceptions

The conversion cannot be performed.

Remarks

The default implementation always returns null.

See also

Applies to

ConvertFromInvariantString(ITypeDescriptorContext, String)

Source:
TypeConverter.cs
Source:
TypeConverter.cs
Source:
TypeConverter.cs

Converts the given string to the type of this converter, using the invariant culture and the specified context.

public:
 System::Object ^ ConvertFromInvariantString(System::ComponentModel::ITypeDescriptorContext ^ context, System::String ^ text);
public object ConvertFromInvariantString (System.ComponentModel.ITypeDescriptorContext context, string text);
public object? ConvertFromInvariantString (System.ComponentModel.ITypeDescriptorContext? context, string text);
member this.ConvertFromInvariantString : System.ComponentModel.ITypeDescriptorContext * string -> obj
Public Function ConvertFromInvariantString (context As ITypeDescriptorContext, text As String) As Object

Parameters

context
ITypeDescriptorContext

An ITypeDescriptorContext that provides a format context.

text
String

The String to convert.

Returns

An Object that represents the converted text.

Exceptions

The conversion cannot be performed.

Remarks

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

Use the context parameter to extract additional information about the environment from which this converter is invoked. This parameter can be null, so always check it. Also, properties on the context object can return null.

See also

Applies to