LengthConverter.CanConvertFrom(ITypeDescriptorContext, Type) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
确定是否可以从指定类型转换为 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。