TypeConverter.CanConvertTo 方法    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回此转换器是否可将该对象转换为指定的类型。
重载
| CanConvertTo(Type) | 
						 返回此转换器是否可将该对象转换为指定的类型。  | 
        	
| CanConvertTo(ITypeDescriptorContext, Type) | 
						 返回此转换器能否使用指定上下文将对象转换为指定类型。  | 
        	
CanConvertTo(Type)
- Source:
 - TypeConverter.cs
 
- Source:
 - TypeConverter.cs
 
- Source:
 - TypeConverter.cs
 
返回此转换器是否可将该对象转换为指定的类型。
public:
 bool CanConvertTo(Type ^ destinationType);
	public bool CanConvertTo (Type destinationType);
	public bool CanConvertTo (Type? destinationType);
	member this.CanConvertTo : Type -> bool
	Public Function CanConvertTo (destinationType As Type) As Boolean
	参数
返回
如果该转换器能够执行转换,则为 true;否则为 false。
注解
如果 destinationType 是字符串,则 的默认 CanConvertTo 实现始终返回 true。
适用于
CanConvertTo(ITypeDescriptorContext, Type)
- Source:
 - TypeConverter.cs
 
- Source:
 - TypeConverter.cs
 
- Source:
 - TypeConverter.cs
 
返回此转换器能否使用指定上下文将对象转换为指定类型。
public:
 virtual bool CanConvertTo(System::ComponentModel::ITypeDescriptorContext ^ context, Type ^ destinationType);
	public virtual bool CanConvertTo (System.ComponentModel.ITypeDescriptorContext context, Type destinationType);
	public virtual bool CanConvertTo (System.ComponentModel.ITypeDescriptorContext? context, Type? destinationType);
	abstract member CanConvertTo : System.ComponentModel.ITypeDescriptorContext * Type -> bool
override this.CanConvertTo : System.ComponentModel.ITypeDescriptorContext * Type -> bool
	Public Overridable Function CanConvertTo (context As ITypeDescriptorContext, destinationType As Type) As Boolean
	参数
- context
 - ITypeDescriptorContext
 
一个 ITypeDescriptorContext,用于提供格式上下文。
返回
如果该转换器能够执行转换,则为 true;否则为 false。
注解
使用 context 参数提取有关调用此转换器的环境的附加信息。 此参数可以是 null,因此始终检查它。 同样,上下文对象的属性可以返回 null。
如果 destinationType 是字符串,则 的默认 CanConvertTo 实现始终返回 true。
继承者说明
重写该方法以提供您自己的转换要求。