NameReferenceConverter.CanConvertTo(ITypeDescriptorContext, Type) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回一个值,该值指示转换器是否可以将对象转换为指定的目标类型。
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
要转换为的类型。
返回
true 如果转换器可以执行转换,则为否则,为 false.
注解
引用类型的destinationType值String返回true;所有其他destinationType值返回false。
此方法返回 false(如果 context 为 null),或者无法 IXamlNameProvider 从中 context获取为服务。