EventSetterHandlerConverter.CanConvertFrom(ITypeDescriptorContext, Type) 方法

定义

返回此转换器是否可以将一种类型的对象转换为 DelegateReturns whether this converter can convert an object of one type to a Delegate.

public:
 override bool CanConvertFrom(System::ComponentModel::ITypeDescriptorContext ^ typeDescriptorContext, Type ^ sourceType);
public override bool CanConvertFrom (System.ComponentModel.ITypeDescriptorContext typeDescriptorContext, Type sourceType);
override this.CanConvertFrom : System.ComponentModel.ITypeDescriptorContext * Type -> bool
Public Overrides Function CanConvertFrom (typeDescriptorContext As ITypeDescriptorContext, sourceType As Type) As Boolean

参数

typeDescriptorContext
ITypeDescriptorContext

一个 ITypeDescriptorContext,用于提供格式上下文。An ITypeDescriptorContext that provides a format context.

sourceType
Type

一个 Type,表示要转换的类型。A Type that represents the type you want to convert from.

返回

Boolean

如果此转换器可以执行转换,则为 true;否则为 falsetrue if this converter can perform the conversion; otherwise, false.

注解

仅当 sourceTypeString 类型时,此方法才返回 trueThis method returns true only when sourceType is a String type. 所有其他 sourceType 类型返回 falseAll other sourceType types return false.

适用于