Share via


StringArrayConverter.CanConvertFrom(ITypeDescriptorContext, Type) 方法

定義

判斷 StringArrayConverter 是否可將指定來源型別轉換成字串陣列。

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 物件,提供可以用來擷取環境相關資訊的格式內容,而該環境是叫用轉換子的來源。 這個參數或這個參數的屬性可為 null

sourceType
Type

要進行轉換的 Type

傳回

如果這個轉換子可以執行作業,則為 true,否則為 false

備註

方法 CanConvertFrom 會判斷 是否可以 StringArrayConverter 將 指定的 sourceType 物件轉換成字串陣列。 在呼叫 方法來執行轉換之前, ConvertFrom 請先使用這個方法。

適用於

另請參閱