ColorTypeConverter.CanConvertTo(ITypeDescriptorContext, Type) 方法

定义

返回一个值,该值指示此 ColorTypeConverter 是否可将 Color 转换为指定类型的实例。

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

提供上下文信息的对象。

destinationType
Type

要将颜色转换为的对象的类型。

返回

Boolean

如果可以进行转换,则为 true;否则为 false

注解

如此类中实现的,此方法仅当为 a StringdestinationType返回true

不使用参数 context 。 请参阅 继承者的说明

继承者说明

重写该方法以提供您自己的转换要求。 使用 context 参数提取有关调用此转换器的环境的附加信息。 此参数可以是 null;因此,请始终检查它。 同样,context 对象的属性也可能返回空引用 (Nothing)。

适用于