XmlLanguageConverter.CanConvertFrom(ITypeDescriptorContext, Type) 方法

定義

傳回值,指出這個轉換子是否能將某一型別的物件轉換為這個轉換子支援的 XmlLanguage 型別。Returns whether this converter can convert an object of one type to the XmlLanguage type supported by this converter.

public:
 override bool CanConvertFrom(System::ComponentModel::ITypeDescriptorContext ^ typeDescriptorContext, Type ^ sourceType);
public override bool CanConvertFrom (System.ComponentModel.ITypeDescriptorContext typeDescriptorContext, Type sourceType);
override this.CanConvertFrom : System.ComponentModel.ITypeDescriptorContext * Type -> bool
Public Overrides Function CanConvertFrom (typeDescriptorContext As ITypeDescriptorContext, sourceType As Type) As Boolean

參數

typeDescriptorContext
ITypeDescriptorContext

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

sourceType
Type

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

傳回

如果這個轉換子可以執行轉換,則為 true,否則為 falsetrue if this converter can perform the conversion; otherwise, false.

備註

這個方法只true sourceType會傳回的StringThis method only returns true for sourceType of String.

適用於

另請參閱