ComponentResourceKeyConverter.CanConvertTo 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
判斷 的 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 無論哪種情況。
例外狀況
destinationType 是 null。
備註
ComponentResourceKey型別不應使用型別轉換路徑來轉換數值(應改用標記擴充)。 因此, CanConvertFrom(ITypeDescriptorContext, Type) 和 CanConvertTo(ITypeDescriptorContext, Type) 方法總是返回 false。
ConvertFrom(ITypeDescriptorContext, CultureInfo, Object)和 ConvertTo(ITypeDescriptorContext, CultureInfo, Object, Type) 方法總是會拋出例外。