UriTypeConverter.CanConvertFrom(ITypeDescriptorContext, Type) 方法

定義

傳回值,指出這個轉換子是否可將指定之型別的物件轉換為這個轉換子的型別。

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

參數

context
ITypeDescriptorContext

提供格式內容的 ITypeDescriptorContext

sourceType
Type

Type,表示要轉換的來源型別。

傳回

如果 sourceTypeString 型別或是可以從 sourceType 指派 Uri 型別,則為 true,否則為 false

例外狀況

sourceType 參數為 null

適用於