ConnectionStringEditor クラス
アセンブリ: System.Design (system.design.dll 内)


ConnectionStringEditor クラスのインスタンスは、デザイン時に接続文字列式を選択および編集し、その式をコントロール プロパティに割り当てるために使用できる UITypeEditor オブジェクトです。たとえば、SqlDataSource コントロールは、デザイン時に ConnectionStringEditor クラスを使用し、ConnectionString プロパティの値を設定します。
ConnectionStringEditor とプロパティとを関連付けるには、EditorAttribute 属性を使用します。関連付けられたプロパティをデザイン サーフェイスで編集する場合、デザイナ ホストによって EditValue メソッドが呼び出されます。EditValue メソッドは、接続文字列式を作成するためのユーザー インターフェイスを表示し、ユーザーが選択した接続文字列を返します。GetEditStyle メソッドは、ユーザー インターフェイスの表示スタイルを示します。

カスタム コントロールに格納されたプロパティで ConnectionStringEditor クラスのインスタンスにアクセスする方法を次のコード例に示します。デザイン サーフェイスでコントロールのプロパティを編集する場合、ConnectionStringEditor クラスは、プロパティ値の接続文字列を選択および編集するためのユーザー インターフェイスを提供します。
' Define a custom class derived from the SqlDataSource Web control. Public Class SqlDataSourceWithBackup Inherits SqlDataSource Private _alternateConnectionString As String ' Define an alternate connection string, which could be used ' as a fallback value if the primary connection string fails. ' The EditorAttribute indicates the property can ' be edited at design-time with the ConnectionStringEditor class. <DefaultValue(""), _ EditorAttribute(GetType(System.Web.UI.Design.ConnectionStringEditor), _ GetType(System.Drawing.Design.UITypeEditor)), _ Category("Data"), _ Description("The alternate connection string.")> _ Public Property AlternateConnectionString() As String Get Return _alternateConnectionString End Get Set(ByVal value As String) _alternateConnectionString = value End Set End Property End Class
// Define a custom class derived from the SqlDataSource Web control. public class SqlDataSourceWithBackup : SqlDataSource { private string _alternateConnectionString; // Define an alternate connection string, which could be used // as a fallback value if the primary connection string fails. // The EditorAttribute indicates the property can // be edited at design-time with the ConnectionStringEditor class. [ DefaultValue(""), EditorAttribute(typeof(System.Web.UI.Design.ConnectionStringEditor), typeof(System.Drawing.Design.UITypeEditor)), Category("Data"), Description("The alternate connection string.") ] public string AlternateConnectionString { get { return _alternateConnectionString; } set { _alternateConnectionString = value; } } }

- SecurityPermission (アンマネージ コードを操作するために必要なアクセス許可)UnmanagedCode (関連する列挙体)

System.Drawing.Design.UITypeEditor
System.Web.UI.Design.ConnectionStringEditor
System.Web.UI.Design.WebControls.SqlDataSourceConnectionStringEditor


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ConnectionStringEditor コンストラクタ
アセンブリ: System.Design (system.design.dll 内)



Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ConnectionStringEditor プロパティ
ConnectionStringEditor メソッド

名前 | 説明 | |
---|---|---|
![]() | EditValue | オーバーロードされます。 GetEditStyle メソッドで提供されたエディタ スタイルを使用して、指定したオブジェクトの値を編集します。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetEditStyle | オーバーロードされます。 接続文字列エディタで使用されている編集スタイルを取得します。 |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetPaintValueSupported | オーバーロードされます。 エディタでオブジェクトの値の視覚的な表現を描画できるかどうかを示します。 ( UITypeEditor から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | PaintValue | オーバーロードされます。 オブジェクトの値の視覚的な表現を描画します。 ( UITypeEditor から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | GetProviderName | ConnectionStringEditor クラスの指定されたインスタンスのプロバイダ名を返します。 |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |
![]() | SetProviderName | ConnectionStringEditor クラスの指定したインスタンスにプロバイダ名を設定します。 |

ConnectionStringEditor メンバ
デザイン時に接続文字列プロパティを選択および編集するためのユーザー インターフェイスの基本クラスを提供します。
ConnectionStringEditor データ型で公開されるメンバを以下の表に示します。



名前 | 説明 | |
---|---|---|
![]() | EditValue | オーバーロードされます。 GetEditStyle メソッドで提供されたエディタ スタイルを使用して、指定したオブジェクトの値を編集します。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetEditStyle | オーバーロードされます。 接続文字列エディタで使用されている編集スタイルを取得します。 |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetPaintValueSupported | オーバーロードされます。 エディタでオブジェクトの値の視覚的な表現を描画できるかどうかを示します。 (UITypeEditor から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | PaintValue | オーバーロードされます。 オブジェクトの値の視覚的な表現を描画します。 (UITypeEditor から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | GetProviderName | ConnectionStringEditor クラスの指定されたインスタンスのプロバイダ名を返します。 |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |
![]() | SetProviderName | ConnectionStringEditor クラスの指定したインスタンスにプロバイダ名を設定します。 |

- ConnectionStringEditorのページへのリンク