XmlLanguageConverter.ConvertTo(ITypeDescriptorContext, CultureInfo, Object, Type) XmlLanguageConverter.ConvertTo(ITypeDescriptorContext, CultureInfo, Object, Type) XmlLanguageConverter.ConvertTo(ITypeDescriptorContext, CultureInfo, Object, Type) Method

定義

將指定的 XmlLanguage 轉換為指定的型別。Converts the specified XmlLanguage to the specified type.

public:
 override System::Object ^ ConvertTo(System::ComponentModel::ITypeDescriptorContext ^ typeDescriptorContext, System::Globalization::CultureInfo ^ cultureInfo, System::Object ^ value, Type ^ destinationType);
[System.Security.SecurityCritical]
public override object ConvertTo (System.ComponentModel.ITypeDescriptorContext typeDescriptorContext, System.Globalization.CultureInfo cultureInfo, object value, Type destinationType);
override this.ConvertTo : System.ComponentModel.ITypeDescriptorContext * System.Globalization.CultureInfo * obj * Type -> obj

參數

typeDescriptorContext
ITypeDescriptorContext ITypeDescriptorContext ITypeDescriptorContext

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

cultureInfo
CultureInfo CultureInfo CultureInfo

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

value
Object Object Object

要轉換的物件。The object to convert. 其型別預期為 XmlLanguageThis is expected to be type XmlLanguage.

destinationType
Type Type Type

型別,表示要轉換的目標型別。A type that represents the type you want to convert to.

傳回

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

例外狀況

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

destinationTypenulldestinationType is null.

備註

destinationTypeString ,這個XmlLanguage方法會傳回所提供的值。IetfLanguageTagFor destinationType String, this method returns the IetfLanguageTag value of the provided XmlLanguage. 針對destinationType 這個InstanceDescriptor方法,會傳回適用于InstanceDescriptor序列化的實例。For destinationType InstanceDescriptor this method returns an InstanceDescriptor instance that is useful for serialization. 其他destinationType輸入會擲回例外狀況。Other destinationType inputs throw exceptions.

適用於

另請參閱