Share via


FontUnitConverter.CanConvertFrom(ITypeDescriptorContext, Type) 方法

定義

判斷資料型別是否可轉換為 FontUnit

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

Type,表示要檢查的資料型別。

傳回

如果由 sourceType 參數指定的資料型別可轉換成 FontUnit,則為 true,否則為 false

備註

CanConvertFrom使用 方法來判斷 參數所 sourceType 指定的資料類型是否可以轉換成 FontUnit

注意

只有當 sourceTypeString 時,這個方法才會傳回 true。 這個轉換子唯一可以轉換成 FontUnit 的類型是 String

適用於

另請參閱