指定したコンテキストを使用して、指定した値をインバリアント カルチャを使用した文字列形式に変換します。
Overloads Public Function ConvertToInvariantString( _
ByVal context As ITypeDescriptorContext, _ ByVal value As Object _) As String
[C#]
public string ConvertToInvariantString(ITypeDescriptorContextcontext,objectvalue);
[C++]
public: String* ConvertToInvariantString(ITypeDescriptorContext* context,Object* value);
[JScript]
public function ConvertToInvariantString(
context : ITypeDescriptorContext,value : Object) : String;
パラメータ
- context
書式指定コンテキストを提供する ITypeDescriptorContext 。 - value
変換対象の Object 。
戻り値
変換後の値を表す String 。
例外
例外の種類 | 条件 |
---|---|
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 ファミリ
参照
TypeConverter クラス | TypeConverter メンバ | System.ComponentModel 名前空間 | TypeConverter.ConvertToInvariantString オーバーロードの一覧 | ITypeDescriptorContext