LowerCaseStringConverter.CanConvertFrom(ITypeDescriptorContext, Type) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
判斷物件是否能根據指定的參數轉換為小寫字串。
public:
override bool CanConvertFrom(System::ComponentModel::ITypeDescriptorContext ^ ctx, Type ^ type);
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext ctx, Type type);
override this.CanConvertFrom : System.ComponentModel.ITypeDescriptorContext * Type -> bool
Public Overrides Function CanConvertFrom (ctx As ITypeDescriptorContext, type As Type) As Boolean
參數
一個實作介面的 ITypeDescriptorContext 物件。
- type
- Type
要轉換的物件類型。
傳回
true若參數描述的物件可轉換為小寫字串物件;否則,。 false
範例
以下範例示範如何使用此方法。
// CanConvertFrom method.
Console.WriteLine("CanConvertFrom: {0}",
myLCStrConverter.CanConvertFrom(ctx, testStrVal.GetType()));
' CanConvertFrom method.
Console.WriteLine("CanConvertFrom: {0}", _
myLCStrConverter.CanConvertFrom(ctx, testStrVal.GetType()))
備註
此方法使用一個實 ITypeDescriptorContext 作介面的物件作為 ctx 參數。 此介面提供元件的上下文資訊。 通常,此介面用於設計時提供設計時容器的資訊。 該 通常 ITypeDescriptorContext 用於類型轉換。 如果需要自訂行為,則在衍生類別中覆寫此方法。