ConfigurationElement.Properties プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ConfigurationElement.Properties プロパティの意味・解説 

ConfigurationElement.Properties プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

プロパティコレクション取得します

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

Protected Friend Overridable
 ReadOnly Property Properties As
 ConfigurationPropertyCollection
Dim value As ConfigurationPropertyCollection

value = Me.Properties
protected internal virtual ConfigurationPropertyCollection Properties
 { get; }
protected public:
virtual property ConfigurationPropertyCollection^ Properties {
    ConfigurationPropertyCollection^ get ();
}
/** @property */
protected ConfigurationPropertyCollection get_Properties ()
protected internal function
 get Properties () : ConfigurationPropertyCollection

プロパティ
要素プロパティの ConfigurationPropertyCollection のコレクション

解説解説
使用例使用例

Properties プロパティ使用する方法の例を次に示します

' Show the use of Properties.
' It displays the ConfigurationElement 
' properties.
Shared Sub GetProperties() 
    
    Try
        ' Get the current configuration file.
        Dim config _
        As System.Configuration.Configuration = _
        ConfigurationManager.OpenExeConfiguration( _
        ConfigurationUserLevel.None)

        ' Get the configuration section MyUrls.
        Dim myUrlsSection As UrlsSection =
 _
        config.Sections("MyUrls")
        
        ' Get the configuration element collection.
        Dim elements As UrlsCollection = _
        myUrlsSection.Urls
        
        Dim elemEnum As IEnumerator = _
        elements.GetEnumerator()
        
        Dim i As Integer
 = 0
        While elemEnum.MoveNext()
            ' Get the current element configuration
            ' property collection.
            Dim properties _
            As PropertyInformationCollection = _
            elements(i).ElementInformation.Properties
            
            ' Display the current configuration 
            ' element properties.
            Dim proprty As PropertyInformation
            For Each proprty In
 properties
                Console.WriteLine("Name: {0}" + _
                vbTab + "Default: {1}" + _
                vbTab + "Required: {2}", _
                [proprty].Name, [proprty].DefaultValue, _
                [proprty].IsRequired.ToString())
            Next proprty
        End While
    
    Catch e As ConfigurationErrorsException
        Console.WriteLine("[GetProperties: {0}]",
 _
        e.ToString())
    End Try

End Sub 'GetProperties

// Show the use of Properties.
// It displays the ConfigurationElement 
// properties.
static void GetProperties()
{

    try
    {
        // Get the current configuration file.
        System.Configuration.Configuration config =
            ConfigurationManager.OpenExeConfiguration(
            ConfigurationUserLevel.None);

        // Get the configuration section MyUrls.
        UrlsSection myUrlsSection =
           config.Sections["MyUrls"] as UrlsSection;

        // Get the configuration element collection.
        UrlsCollection elements =
            myUrlsSection.Urls;

        IEnumerator elemEnum =
            elements.GetEnumerator();

        int i = 0;
        while (elemEnum.MoveNext())
        {
            // Get the current element configuration
            // property collection.
            PropertyInformationCollection properties =
                elements[i].ElementInformation.Properties;

            // Display the current configuration 
            // element properties.
            foreach (PropertyInformation property in
 properties)
            {
                Console.WriteLine("Name: {0}\tDefault: {1}\tRequired: {2}"
,
                 property.Name, property.DefaultValue,
                 property.IsRequired.ToString());
            }
        }

    }
    catch (ConfigurationErrorsException e)
    {
        Console.WriteLine("[GetProperties: {0}]",
            e.ToString());
    }

}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ConfigurationElement クラス
ConfigurationElement メンバ
System.Configuration 名前空間
ConfigurationPropertyCollection


このページでは「.NET Framework クラス ライブラリ リファレンス」からConfigurationElement.Properties プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からConfigurationElement.Properties プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からConfigurationElement.Properties プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

ConfigurationElement.Properties プロパティのお隣キーワード
検索ランキング

   

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



ConfigurationElement.Properties プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS