DataColumnSelectionConverter.CanConvertFrom 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
表示是否能將指定的來源類型轉換為相關控制屬性的類型。
public:
override bool CanConvertFrom(System::ComponentModel::ITypeDescriptorContext ^ context, Type ^ sourceType);
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, Type sourceType);
override this.CanConvertFrom : System.ComponentModel.ITypeDescriptorContext * Type -> bool
Public Overrides Function CanConvertFrom (context As ITypeDescriptorContext, sourceType As Type) As Boolean
參數
- context
- ITypeDescriptorContext
一種 ITypeDescriptorContext 可用來獲取額外上下文資訊的實作。
- sourceType
- Type
是從那種人轉換的類型。
傳回
true如果轉換器能執行轉換;否則,。 false
備註
呼叫該 CanConvertFrom 方法以判斷該 ConvertFrom 方法是否支援轉換原始碼型別。
該ConvertFrom方法只能從字串轉換,因此當 CanConvertFrom 是字串時,方法true會回傳sourceType。