ElementInformationとは? わかりやすく解説

ElementInformation クラス

メモ : このクラスは、.NET Framework version 2.0 で新しく追加されたものです。

構成内の個々の要素に関するメタ情報が含まれています。このクラスは継承できません。

名前空間: System.Configuration
アセンブリ: System.Configuration (system.configuration.dll 内)
構文構文

Public NotInheritable Class
 ElementInformation
Dim instance As ElementInformation
public sealed class ElementInformation
public ref class ElementInformation sealed
public final class ElementInformation
public final class ElementInformation
解説解説
使用例使用例

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.Object
  System.Configuration.ElementInformation
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ElementInformation メンバ
System.Configuration 名前空間
ConfigurationElement クラス

ElementInformation プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ Errors 関連付けられている要素およびサブ要素のエラーを取得します。
パブリック プロパティ IsCollection 関連付けられている ConfigurationElement オブジェクトが ConfigurationElementCollection コレクションであるかどうかを示す値を取得します。
パブリック プロパティ IsLocked ConfigurationElement オブジェクトが変更できないかどうかを示す値を取得します。
パブリック プロパティ IsPresent 関連付けられている ConfigurationElement オブジェクトが構成ファイル内に存在するかどうかを示す値を取得します。
パブリック プロパティ LineNumber 構成ファイル内の、関連付けられている ConfigurationElement オブジェクトが定義されている位置の行番号を取得します。
パブリック プロパティ Properties 関連付けられている ConfigurationElement オブジェクトのプロパティの PropertyInformationCollection コレクションを取得します。
パブリック プロパティ Source 関連付けられている ConfigurationElement オブジェクトの生成元であるソース ファイルを取得します。
パブリック プロパティ Type 関連付けられている ConfigurationElement オブジェクトの Type を取得します。
パブリック プロパティ Validator 関連付けられている ConfigurationElement オブジェクトの検証に使用されるオブジェクトを取得します。
参照参照

関連項目

ElementInformation クラス
System.Configuration 名前空間
ConfigurationElement クラス

ElementInformation メソッド


ElementInformation メンバ

構成内の個々の要素に関するメタ情報が含まれています。このクラスは継承できません。

ElementInformation データ型で公開されるメンバを以下の表に示します。


パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ Errors 関連付けられている要素およびサブ要素のエラーを取得します。
パブリック プロパティ IsCollection 関連付けられている ConfigurationElement オブジェクトが ConfigurationElementCollection コレクションであるかどうかを示す値を取得します。
パブリック プロパティ IsLocked ConfigurationElement オブジェクトが変更できないかどうかを示す値を取得します。
パブリック プロパティ IsPresent 関連付けられている ConfigurationElement オブジェクトが構成ファイル内に存在するかどうかを示す値を取得します。
パブリック プロパティ LineNumber 構成ファイル内の、関連付けられている ConfigurationElement オブジェクトが定義されている位置の行番号を取得します。
パブリック プロパティ Properties 関連付けられている ConfigurationElement オブジェクトのプロパティの PropertyInformationCollection コレクションを取得します。
パブリック プロパティ Source 関連付けられている ConfigurationElement オブジェクトの生成元であるソース ファイルを取得します。
パブリック プロパティ Type 関連付けられている ConfigurationElement オブジェクトの Type を取得します。
パブリック プロパティ Validator 関連付けられている ConfigurationElement オブジェクトの検証に使用されるオブジェクトを取得します。
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

ElementInformation クラス
System.Configuration 名前空間
ConfigurationElement クラス



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「ElementInformation」の関連用語

ElementInformationのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ElementInformationのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS