指定したコンテキストと引数を使用して、値オブジェクトを目的の型に変換します。
Overrides Overloads Public Function ConvertTo( _
ByVal context As ITypeDescriptorContext, _ ByVal culture As CultureInfo, _ ByVal value As Object, _ ByVal destinationType As Type _) As Object
[C#]
public override object ConvertTo(ITypeDescriptorContextcontext,CultureInfoculture,objectvalue,TypedestinationType);
[C++]
public: Object* ConvertTo(ITypeDescriptorContext* context,CultureInfo* culture,Object* value,Type* destinationType);
[JScript]
public override function ConvertTo(
context : ITypeDescriptorContext,culture : CultureInfo,value : Object,destinationType : Type) : Object;
パラメータ
- context
書式指定コンテキストを提供する ITypeDescriptorContext 。 - culture
変換後の言語を提供する CultureInfo 。 - value
変換対象の Object 。 - destinationType
値の変換後の Type 。
戻り値
変換後の値を表す Object 。
例外
例外の種類 | 条件 |
---|---|
ArgumentNullException | destinationType が null 参照 (Visual Basic では Nothing) です。 |
NotSupportedException | 変換できませんでした。 |
解説
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.ConvertTo オーバーロードの一覧 | CultureInfo | ITypeDescriptorContext | Object | Type