ElementInformation クラス
アセンブリ: System.Configuration (system.configuration.dll 内)
構文
解説
使用例ConfigurationElement オブジェクトに関連付けられている ElementInformation を取得するコード例を次に示します。
Public Shared Function GetElementInformation() _ As ElementInformation ' Get the current configuration file. Dim config _ As System.Configuration.Configuration = _ ConfigurationManager.OpenExeConfiguration( _ ConfigurationUserLevel.None) ' Get the section. Dim section As UrlsSection = CType( _ config.GetSection("MyUrls"), UrlsSection) ' Get the element. Dim url As UrlConfigElement = _ section.Simple Dim eInfo As ElementInformation = _ url.ElementInformation Return eInfo End Function 'GetElementInformation
static public ElementInformation GetElementInformation() { // Get the current configuration file. System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration( ConfigurationUserLevel.None); // Get the section. UrlsSection section = (UrlsSection)config.GetSection("MyUrls"); // Get the element. UrlConfigElement url = section.Simple; ElementInformation eInfo = url.ElementInformation; return eInfo; }
<?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="MyUrls" type="Samples.AspNet.UrlsSection, ConfigurationElement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" allowDefinition="Everywhere" allowExeDefinition="MachineToApplication" restartOnExternalChanges="true" /> </configSections> <MyUrls name="MyFavorites"> <simple name="Contoso" url="http://www.contoso.com" port="8080" /> <urls> <clear /> <add name="Microsoft" url="http://www.microsoft.com" port="0" /> </urls> </MyUrls> </configuration>
継承階層System.Configuration.ElementInformation
スレッド セーフ
プラットフォームWindows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照ElementInformation プロパティ
パブリック プロパティ| 名前 | 説明 | |
|---|---|---|
| Errors | 関連付けられている要素およびサブ要素のエラーを取得します。 |
| IsCollection | 関連付けられている ConfigurationElement オブジェクトが ConfigurationElementCollection コレクションであるかどうかを示す値を取得します。 |
| IsLocked | ConfigurationElement オブジェクトが変更できないかどうかを示す値を取得します。 |
| IsPresent | 関連付けられている ConfigurationElement オブジェクトが構成ファイル内に存在するかどうかを示す値を取得します。 |
| LineNumber | 構成ファイル内の、関連付けられている ConfigurationElement オブジェクトが定義されている位置の行番号を取得します。 |
| Properties | 関連付けられている ConfigurationElement オブジェクトのプロパティの PropertyInformationCollection コレクションを取得します。 |
| Source | 関連付けられている ConfigurationElement オブジェクトの生成元であるソース ファイルを取得します。 |
| Type | 関連付けられている ConfigurationElement オブジェクトの Type を取得します。 |
| Validator | 関連付けられている ConfigurationElement オブジェクトの検証に使用されるオブジェクトを取得します。 |
参照ElementInformation メソッド
パブリック メソッド| 名前 | 説明 | |
|---|---|---|
| Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
| GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
| GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
| ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
| ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |
プロテクト メソッド| 名前 | 説明 | |
|---|---|---|
| Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
| MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |
参照ElementInformation メンバ
構成内の個々の要素に関するメタ情報が含まれています。このクラスは継承できません。
ElementInformation データ型で公開されるメンバを以下の表に示します。
パブリック プロパティ| 名前 | 説明 | |
|---|---|---|
| Errors | 関連付けられている要素およびサブ要素のエラーを取得します。 |
| IsCollection | 関連付けられている ConfigurationElement オブジェクトが ConfigurationElementCollection コレクションであるかどうかを示す値を取得します。 |
| IsLocked | ConfigurationElement オブジェクトが変更できないかどうかを示す値を取得します。 |
| IsPresent | 関連付けられている ConfigurationElement オブジェクトが構成ファイル内に存在するかどうかを示す値を取得します。 |
| LineNumber | 構成ファイル内の、関連付けられている ConfigurationElement オブジェクトが定義されている位置の行番号を取得します。 |
| Properties | 関連付けられている ConfigurationElement オブジェクトのプロパティの PropertyInformationCollection コレクションを取得します。 |
| Source | 関連付けられている ConfigurationElement オブジェクトの生成元であるソース ファイルを取得します。 |
| Type | 関連付けられている ConfigurationElement オブジェクトの Type を取得します。 |
| Validator | 関連付けられている ConfigurationElement オブジェクトの検証に使用されるオブジェクトを取得します。 |
パブリック メソッド| 名前 | 説明 | |
|---|---|---|
| Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
| GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
| GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
| ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
| ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |
プロテクト メソッド| 名前 | 説明 | |
|---|---|---|
| Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
| MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |
参照- ElementInformationのページへのリンク