対象のコンバータが、指定したコンテキストを使用して、指定した変換前の型のオブジェクトをコンバータのネイティブの型に変換できるかどうかを返します。
Overrides Overloads Public Function CanConvertFrom( _
ByVal context As ITypeDescriptorContext, _ ByVal sourceType As Type _) As Boolean
[C#]
public override bool CanConvertFrom(ITypeDescriptorContextcontext,TypesourceType);
[C++]
public: bool CanConvertFrom(ITypeDescriptorContext* context,Type* sourceType);
[JScript]
public override function CanConvertFrom(
context : ITypeDescriptorContext,sourceType : Type) : Boolean;
パラメータ
- context
書式指定コンテキストを提供する ITypeDescriptorContext 。 - sourceType
変換前の型を表す Type 。
戻り値
オブジェクトが変換を実行できる場合は true 。それ以外の場合は false 。
解説
context パラメータを使用して、コンバータを呼び出している環境についての追加情報を抽出できます。これは null 参照 (Visual Basic では Nothing) の場合があるため、常に確認してください。また、コンテキスト オブジェクトのプロパティも null 参照 (Nothing) を返す場合があります。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
参照
MarginsConverter クラス | MarginsConverter メンバ | System.Drawing.Printing 名前空間 | MarginsConverter.CanConvertFrom オーバーロードの一覧 | CultureInfo | ITypeDescriptorContext | Type