ComponentResourceKeyConverter.CanConvertTo 方法

定義

使用指定的內容,判斷 ComponentResourceKey 的執行個體是否可以轉換成指定的型別。 一律傳回 false

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

public:
 override bool CanConvertTo(System::ComponentModel::ITypeDescriptorContext ^ context, Type ^ destinationType);
public override bool CanConvertTo (System.ComponentModel.ITypeDescriptorContext context, Type destinationType);
override this.CanConvertTo : System.ComponentModel.ITypeDescriptorContext * Type -> bool
Public Overrides Function CanConvertTo (context As ITypeDescriptorContext, destinationType As Type) As Boolean

參數

context
ITypeDescriptorContext

格式內容,提供正在叫用此轉換器之環境的相關資訊。

destinationType
Type

正在評估以進行轉換的型別。

傳回

所有情況下都是 false

例外狀況

destinationTypenull

備註

類型 ComponentResourceKey 不應該使用類型轉換器路徑來轉換值, (應該改用標記延伸) 。 基於這個理由, CanConvertFrom(ITypeDescriptorContext, Type)CanConvertTo(ITypeDescriptorContext, Type) 方法一律會傳回 falseConvertFrom(ITypeDescriptorContext, CultureInfo, Object)ConvertTo(ITypeDescriptorContext, CultureInfo, Object, Type) 方法一律會擲回例外狀況。

適用於