语言

LengthConverter.CanConvertFrom(ITypeDescriptorContext, Type) 方法

定义

确定是否可以从指定类型转换为 Double 表示对象的长度。

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

提供有关组件的上下文信息。

sourceType
Type

标识要计算转换的数据类型。

返回

true 如果可能,则为否则,为 false.

注解

LengthConverter 支持从以下类型进行转换: String、、 Decimal、 Single、 Double、 Int16、、 Int32、 Int64、 UInt16、 UInt32和 UInt64。

适用于