RectangleConverter.CanConvertTo(ITypeDescriptorContext, Type) 方法

定义

获取一个值,该值指示此转换器是否可以使用上下文将对象转换为给定的目标类型。

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 格式上下文的对象。 这可以是 null,因此应始终检查。 此外,上下文对象上的属性也可以返回 null

destinationType
Type

一个 Type 对象,表示要转换为的类型。

返回

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

注解

context该参数可用于获取有关此转换器从中调用的环境的其他信息。

适用于