语言

ImageConverter.CanConvertTo(ITypeDescriptorContext, Type) 方法

定义

确定这 ImageConverter 是否可以使用指定的上下文将指定 Image 类型的实例转换为实例。

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

参数

context
ITypeDescriptorContext

提供格式上下文的一 ITypeDescriptorContext 个。

destinationType
Type

一个 Type ,指定要转换为的类型。

返回

如果此方法true可以执行转换,则返回ImageConverter;否则为 false。

注解

仅当等于字节数组或字符串时true,此方法才返回sourceType。

适用于