DateTimeConverter.CanConvertFrom(ITypeDescriptorContext, Type) メソッド

定義

このコンバーターが、指定したコンテキストを使用して特定の型のオブジェクトを DateTime に変換できるかどうかを示す値を取得します。

public:
 override bool CanConvertFrom(System::ComponentModel::ITypeDescriptorContext ^ context, Type ^ sourceType);
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

戻り値

このオブジェクトが変換を実行できる場合は true、それ以外の場合は false です。

注釈

このコンバーターは、 を文字列との間でのみ変換 DateTime できます。

context パラメーターを使用すると、このコンバーターが呼び出されている環境についての追加情報を抽出できます。 これは null の場合があるため、常に確認してください。 また、コンテキスト オブジェクトのプロパティも null を返す場合があります。

適用対象

こちらもご覧ください