TypeConverter.ConvertFromInvariantString TypeConverter.ConvertFromInvariantString TypeConverter.ConvertFromInvariantString TypeConverter.ConvertFromInvariantString Method

定義

會使用不因文化特性而異,將值轉換為這個轉換子的型別。Converts the value to a type of this converter, using the invariant culture.

多載

ConvertFromInvariantString(String) ConvertFromInvariantString(String) ConvertFromInvariantString(String) ConvertFromInvariantString(String)

會使用不因文化特性而異,將指定字串轉換為這個轉換子的型別。Converts the given string to the type of this converter, using the invariant culture.

ConvertFromInvariantString(ITypeDescriptorContext, String) ConvertFromInvariantString(ITypeDescriptorContext, String) ConvertFromInvariantString(ITypeDescriptorContext, String) ConvertFromInvariantString(ITypeDescriptorContext, String)

會使用不區分的文化特性和指定的內容,將指定的字串轉換為這個轉換子的型別。Converts the given string to the type of this converter, using the invariant culture and the specified context.

ConvertFromInvariantString(String) ConvertFromInvariantString(String) ConvertFromInvariantString(String) ConvertFromInvariantString(String)

會使用不因文化特性而異,將指定字串轉換為這個轉換子的型別。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);
member this.ConvertFromInvariantString : string -> obj
Public Function ConvertFromInvariantString (text As String) As Object

參數

text
String String String String

要進行轉換的 StringThe String to convert.

傳回

表示轉換文字的 ObjectAn Object that represents the converted text.

例外狀況

無法執行轉換作業。The conversion cannot be performed.

備註

預設的實作 (Implementation) 一定會傳回 nullThe default implementation always returns null.

另請參閱

ConvertFromInvariantString(ITypeDescriptorContext, String) ConvertFromInvariantString(ITypeDescriptorContext, String) ConvertFromInvariantString(ITypeDescriptorContext, String) ConvertFromInvariantString(ITypeDescriptorContext, String)

會使用不區分的文化特性和指定的內容,將指定的字串轉換為這個轉換子的型別。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);
member this.ConvertFromInvariantString : System.ComponentModel.ITypeDescriptorContext * string -> obj
Public Function ConvertFromInvariantString (context As ITypeDescriptorContext, text As String) As Object

參數

text
String String String String

要進行轉換的 StringThe String to convert.

傳回

表示轉換文字的 ObjectAn Object that represents the converted text.

例外狀況

無法執行轉換作業。The conversion cannot be performed.

備註

如果字串無法轉換成適當的物件,會引發例外狀況。An exception is raised if the string cannot be converted into the appropriate object. 預設的實作 (Implementation) 一定會傳回 nullThe default implementation always returns null.

context 參數可以用於擷取環境的其他資訊,而這個轉換子就是從該環境叫用的。Use the context parameter to extract additional information about the environment from which this converter is invoked. 這個參數可以是null,所以一定要檢查。This parameter can be null, so always check it. 甚至,內容物件上的屬性可能會傳回 nullAlso, properties on the context object can return null.

另請參閱

適用於