TypeConverter.CanConvertTo メソッド
定義
コンバーターがオブジェクトを指定した型に変換できるかどうかを示す値を返します。Returns whether this converter can convert the object to the specified type.
オーバーロード
CanConvertTo(Type) |
コンバーターがオブジェクトを指定した型に変換できるかどうかを示す値を返します。Returns whether this converter can convert the object to the specified type. |
CanConvertTo(ITypeDescriptorContext, Type) |
このコンバーターが指定のコンテキストを使用して、オブジェクトを指定の型に変換できるかどうかを返します。Returns whether this converter can convert the object to the specified type, using the specified context. |
CanConvertTo(Type)
コンバーターがオブジェクトを指定した型に変換できるかどうかを示す値を返します。Returns whether this converter can convert the object to the specified type.
public:
bool CanConvertTo(Type ^ destinationType);
public bool CanConvertTo (Type destinationType);
member this.CanConvertTo : Type -> bool
Public Function CanConvertTo (destinationType As Type) As Boolean
パラメーター
戻り値
コンバーターが変換を実行できる場合は true
。それ以外の場合は false
。true
if this converter can perform the conversion; otherwise, false
.
注釈
がdestinationType
文字列の場合、の既定のCanConvertTo実装は常true
にを返します。If destinationType
is a string, the default implementation of CanConvertTo always returns true
.
CanConvertTo(ITypeDescriptorContext, Type)
このコンバーターが指定のコンテキストを使用して、オブジェクトを指定の型に変換できるかどうかを返します。Returns whether this converter can convert the object to the specified type, using the specified context.
public:
virtual bool CanConvertTo(System::ComponentModel::ITypeDescriptorContext ^ context, Type ^ destinationType);
public virtual bool CanConvertTo (System.ComponentModel.ITypeDescriptorContext context, Type destinationType);
abstract member CanConvertTo : System.ComponentModel.ITypeDescriptorContext * Type -> bool
override this.CanConvertTo : System.ComponentModel.ITypeDescriptorContext * Type -> bool
Public Overridable Function CanConvertTo (context As ITypeDescriptorContext, destinationType As Type) As Boolean
パラメーター
- context
- ITypeDescriptorContext
書式指定コンテキストを提供する ITypeDescriptorContext。An ITypeDescriptorContext that provides a format context.
戻り値
コンバーターが変換を実行できる場合は true
。それ以外の場合は false
。true
if this converter can perform the conversion; otherwise, false
.
注釈
コンバーターが呼び出される環境に関する追加情報を抽出するには、context
パラメーターを使用します。Use the context
parameter to extract additional information about the environment from which this converter is invoked. このパラメーターはにnull
することができるため、常に確認してください。This parameter can be null
, so always check it. また、コンテキスト オブジェクトのプロパティも null
を返す場合があります。Also, properties on the context object can return null
.
がdestinationType
文字列の場合、の既定のCanConvertTo実装は常true
にを返します。If destinationType
is a string, the default implementation of CanConvertTo always returns true
.
注意 (継承者)
独自の変換要件を指定するには、このメソッドをオーバーライドします。Override this method to provide your own conversion requirements.