XmlLanguageConverter.ConvertFrom(ITypeDescriptorContext, CultureInfo, Object) XmlLanguageConverter.ConvertFrom(ITypeDescriptorContext, CultureInfo, Object) XmlLanguageConverter.ConvertFrom(ITypeDescriptorContext, CultureInfo, Object) Method

定義

將指定的字串值轉換為這個轉換子支援的 XmlLanguage 型別。Converts the specified string value to the XmlLanguage type supported by this converter.

public:
 override System::Object ^ ConvertFrom(System::ComponentModel::ITypeDescriptorContext ^ typeDescriptorContext, System::Globalization::CultureInfo ^ cultureInfo, System::Object ^ source);
public override object ConvertFrom (System.ComponentModel.ITypeDescriptorContext typeDescriptorContext, System.Globalization.CultureInfo cultureInfo, object source);
override this.ConvertFrom : System.ComponentModel.ITypeDescriptorContext * System.Globalization.CultureInfo * obj -> obj

參數

typeDescriptorContext
ITypeDescriptorContext ITypeDescriptorContext ITypeDescriptorContext

提供格式內容的 ITypeDescriptorContextAn ITypeDescriptorContext that provides a format context.

cultureInfo
CultureInfo CultureInfo CultureInfo

要用作目前文化特性的 CultureInfoThe CultureInfo to use as the current culture.

source
Object Object Object

要轉換的字串。The string to convert.

傳回

物件,表示轉換的值。An object that represents the converted value.

例外狀況

無法執行轉換。Conversion could not be performed.

備註

source值必須是字串, 否則會擲回例外狀況。The source value must be a string, otherwise an exception is thrown. 如果轉換成功, 則傳回值為XmlLanguageIf the conversion is successful, the return value is a XmlLanguage.

就內部而言, 這個XmlLanguage.GetLanguage方法會呼叫。Internally, this method calls XmlLanguage.GetLanguage. GetLanguage需其他例外狀況資訊, 請參閱。See GetLanguage for additional exception information.

適用於

另請參閱