ConfigurationSectionCollection クラス

定義

構成ファイル内の関連セクションのコレクションを表します。Represents a collection of related sections within a configuration file.

public ref class ConfigurationSectionCollection sealed : System::Collections::Specialized::NameObjectCollectionBase
[System.Serializable]
public sealed class ConfigurationSectionCollection : System.Collections.Specialized.NameObjectCollectionBase
type ConfigurationSectionCollection = class
    inherit NameObjectCollectionBase
Public NotInheritable Class ConfigurationSectionCollection
Inherits NameObjectCollectionBase
継承
ConfigurationSectionCollection
属性

ConfigurationSectionCollection クラスを使用するコード例を次に示します。The following code example shows how to use the ConfigurationSectionCollection class.

using System;
using System.Configuration;
using System.Collections;

namespace Samples.AspNet.Configuration
{


    // Define a custom section programmatically.
    public sealed class CustomSection :
        ConfigurationSection
    {
        // The collection (property bag) that contains 
        // the section properties.
        private static ConfigurationPropertyCollection _Properties;


        // The FileName property.
        private static readonly ConfigurationProperty _FileName =
            new ConfigurationProperty("fileName",
            typeof(string), "default.txt",
            ConfigurationPropertyOptions.IsRequired);

        // The MasUsers property.
        private static readonly ConfigurationProperty _MaxUsers =
            new ConfigurationProperty("maxUsers",
            typeof(long), (long)1000,
            ConfigurationPropertyOptions.None);

        // The MaxIdleTime property.
        private static readonly ConfigurationProperty _MaxIdleTime =
            new ConfigurationProperty("maxIdleTime",
            typeof(TimeSpan), TimeSpan.FromMinutes(5),
            ConfigurationPropertyOptions.IsRequired);

        // CustomSection constructor.
        public CustomSection()
        {
            // Property initialization
            _Properties =
                new ConfigurationPropertyCollection();

            _Properties.Add(_FileName);
            _Properties.Add(_MaxUsers);
            _Properties.Add(_MaxIdleTime);
        }


        // This is a key customization. 
        // It returns the initialized property bag.
        protected override ConfigurationPropertyCollection Properties
        {
            get
            {
                return _Properties;
            }
        }



        [StringValidator(InvalidCharacters = " ~!@#$%^&*()[]{}/;'\"|\\",
            MinLength = 1, MaxLength = 60)]
        public string FileName
        {
            get
            {
                return (string)this["fileName"];
            }
            set
            {

                this["fileName"] = value;
            }
        }

        [LongValidator(MinValue = 1, MaxValue = 1000000,
            ExcludeRange = false)]
        public long MaxUsers
        {
            get
            {
                return (long)this["maxUsers"];
            }
            set
            {
                this["maxUsers"] = value;
            }
        }

        [TimeSpanValidator(MinValueString = "0:0:30",
            MaxValueString = "5:00:0",
            ExcludeRange = false)]
        public TimeSpan MaxIdleTime
        {
            get
            {
                return (TimeSpan)this["maxIdleTime"];
            }
            set
            {
                this["maxIdleTime"] = value;
            }
        }


    }


    class UsingCustomSectionCollection
    {

        // Create a custom section.
        static void CreateSection()
        {
            try
            {

                CustomSection customSection;

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

                // Create the section entry  
                // in the <configSections> and the 
                // related target section in <configuration>.
                if (config.Sections["CustomSection"] == null)
                {
                    customSection = new CustomSection();
                    config.Sections.Add("CustomSection", customSection);
                    customSection.SectionInformation.ForceSave = true;
                    config.Save(ConfigurationSaveMode.Full);
                }
            }
            catch (ConfigurationErrorsException err)
            {
                Console.WriteLine(err.ToString());
            }

        }

        static void GetAllKeys()
        {

            try
            {
                System.Configuration.Configuration config =
                ConfigurationManager.OpenExeConfiguration(
                ConfigurationUserLevel.None);


                ConfigurationSectionCollection sections =
                    config.Sections;

                foreach (string key in sections.Keys)
                {
                    Console.WriteLine(
                     "Key value: {0}", key);
                }


            }
            catch (ConfigurationErrorsException err)
            {
                Console.WriteLine(err.ToString());
            }
        }


        static void Clear()
        {

            try
            {
                System.Configuration.Configuration config =
                ConfigurationManager.OpenExeConfiguration(
                ConfigurationUserLevel.None);

                config.Sections.Clear();

                config.Save(ConfigurationSaveMode.Full);
            }
            catch (ConfigurationErrorsException err)
            {
                Console.WriteLine(err.ToString());
            }
        }


        static void GetSection()
        {

            try
            {
                CustomSection customSection =
                    ConfigurationManager.GetSection(
                    "CustomSection") as CustomSection;

                if (customSection == null)
                    Console.WriteLine(
                        "Failed to load CustomSection.");
                else
                {
                    // Display section information
                    Console.WriteLine("Defaults:");
                    Console.WriteLine("File Name:       {0}",
                        customSection.FileName);
                    Console.WriteLine("Max Users:       {0}",
                        customSection.MaxUsers);
                    Console.WriteLine("Max Idle Time:   {0}",
                        customSection.MaxIdleTime);

                }

            }
            catch (ConfigurationErrorsException err)
            {
                Console.WriteLine(err.ToString());
            }
        }

        static void GetEnumerator()
        {

            try
            {
                System.Configuration.Configuration config =
                ConfigurationManager.OpenExeConfiguration(
                ConfigurationUserLevel.None);


                ConfigurationSectionCollection sections =
                    config.Sections;

                IEnumerator secEnum =
                    sections.GetEnumerator();

                int i = 0;
                while (secEnum.MoveNext())
                {
                    string setionName = sections.GetKey(i);
                    Console.WriteLine(
                        "Section name: {0}", setionName);
                    i += 1;
                }
            }
            catch (ConfigurationErrorsException err)
            {
                Console.WriteLine(err.ToString());
            }
        }


        static void GetKeys()
        {

            try
            {
                System.Configuration.Configuration config =
                ConfigurationManager.OpenExeConfiguration(
                ConfigurationUserLevel.None);

                ConfigurationSectionCollection sections =
                    config.Sections;


                foreach (string key in sections.Keys)
                {


                    Console.WriteLine(
                     "Key value: {0}", key);
                }


            }
            catch (ConfigurationErrorsException err)
            {
                Console.WriteLine(err.ToString());
            }
        }


        static void GetItems()
        {

            try
            {
                System.Configuration.Configuration config =
                ConfigurationManager.OpenExeConfiguration(
                ConfigurationUserLevel.None);

                ConfigurationSectionCollection sections =
                    config.Sections;


                ConfigurationSection section1 =
                    sections["runtime"];

                ConfigurationSection section2 =
                    sections[0];

                Console.WriteLine(
                     "Section1: {0}", section1.SectionInformation.Name);

                Console.WriteLine(
                    "Section2: {0}", section2.SectionInformation.Name);

            }
            catch (ConfigurationErrorsException err)
            {
                Console.WriteLine(err.ToString());
            }
        }


        static void Remove()
        {

            try
            {
                System.Configuration.Configuration config =
                ConfigurationManager.OpenExeConfiguration(
                ConfigurationUserLevel.None);

                CustomSection customSection =
                    config.GetSection(
                    "CustomSection") as CustomSection;


                if (customSection != null)
                {
                    config.Sections.Remove("CustomSection");
                    customSection.SectionInformation.ForceSave = true;
                    config.Save(ConfigurationSaveMode.Full);
                }
                else
                    Console.WriteLine(
                        "CustomSection does not exists.");

            }
            catch (ConfigurationErrorsException err)
            {
                Console.WriteLine(err.ToString());
            }
        }


        static void AddSection()
        {

            try
            {
                System.Configuration.Configuration config =
                ConfigurationManager.OpenExeConfiguration(
                ConfigurationUserLevel.None);

                CustomSection customSection =
                    new CustomSection();


                string index =
                    config.Sections.Count.ToString();

                customSection.FileName =
                    "newFile" + index + ".txt";

                string sectionName = "CustomSection" + index;

                TimeSpan ts = new TimeSpan(0, 15, 0);
                customSection.MaxIdleTime = ts;
                customSection.MaxUsers = 100;

                config.Sections.Add(sectionName, customSection);
                customSection.SectionInformation.ForceSave = true;
                config.Save(ConfigurationSaveMode.Full);
            }
            catch (ConfigurationErrorsException err)
            {
                Console.WriteLine(err.ToString());
            }
        }


        // Exercise the collection.
        // Uncomment the function you want to exercise.
        // Start with CreateSection().
        static void Main(string[] args)
        {
            CreateSection();
            // AddSection();
            // GetSection();
            // GetEnumerator();
            // GetAllKeys();
            // GetKeys();
            // GetItems();

            // Remove();
            // Clear();
        }


    }
}
Imports System.Configuration
Imports System.Collections




' Define a custom section programmatically.

Public NotInheritable Class CustomSection
    Inherits ConfigurationSection
    ' The collection (property bag) that contains 
    ' the section properties.
    Private Shared _Properties _
    As ConfigurationPropertyCollection


    ' The FileName property.
    Private Shared _FileName _
    As New ConfigurationProperty("fileName", _
    GetType(String), "default.txt", _
    ConfigurationPropertyOptions.IsRequired)

    ' The MasUsers property.
    Private Shared _MaxUsers _
    As New ConfigurationProperty("maxUsers", _
    GetType(Long), Fix(1000), _
    ConfigurationPropertyOptions.None)

    ' The MaxIdleTime property.
    Private Shared _MaxIdleTime _
    As New ConfigurationProperty("maxIdleTime", _
    GetType(TimeSpan), TimeSpan.FromMinutes(5), _
    ConfigurationPropertyOptions.IsRequired)


    ' CustomSection constructor.
    Public Sub New()
        ' Property initialization
        _Properties = _
        New ConfigurationPropertyCollection()

        _Properties.Add(_FileName)
        _Properties.Add(_MaxUsers)
        _Properties.Add(_MaxIdleTime)
    End Sub


    ' This is a key customization. 
    ' It returns the initialized property bag.
    Protected Overrides ReadOnly Property Properties() _
    As ConfigurationPropertyCollection
        Get
            Return _Properties
        End Get
    End Property



    <StringValidator( _
    InvalidCharacters:=" ~!@#$%^&*()[]{}/;'""|\", _
    MinLength:=1, MaxLength:=60)> _
    Public Property FileName() As String
        Get
            Return CStr(Me("fileName"))
        End Get
        Set(ByVal value As String)

            Me("fileName") = value
        End Set
    End Property


    <LongValidator(MinValue:=1, _
    MaxValue:=1000000, ExcludeRange:=False)> _
    Public Property MaxUsers() As Long
        Get
            Return Fix(Me("maxUsers"))
        End Get
        Set(ByVal value As Long)
            Me("maxUsers") = value
        End Set
    End Property


    <TimeSpanValidator(MinValueString:="0:0:30", _
    MaxValueString:="5:00:0", ExcludeRange:=False)> _
    Public Property MaxIdleTime() As TimeSpan
        Get
            Return CType(Me("maxIdleTime"), TimeSpan)
        End Get
        Set(ByVal value As TimeSpan)
            Me("maxIdleTime") = value
        End Set
    End Property
End Class




Class UsingCustomSectionCollection


    ' Create a custom section.
    Shared Sub CreateSection()
        Try

            Dim customSection As CustomSection

            ' Get the current configuration file.
            Dim config _
            As System.Configuration.Configuration = _
            ConfigurationManager.OpenExeConfiguration( _
            ConfigurationUserLevel.None)

            ' Create the section entry  
            ' in the <configSections> and the 
            ' related target section in <configuration>.
            If config.Sections("CustomSection") Is Nothing Then
                customSection = New CustomSection()
                config.Sections.Add("CustomSection", customSection)
                customSection.SectionInformation.ForceSave = True
                config.Save(ConfigurationSaveMode.Full)
            End If
        Catch err As ConfigurationErrorsException
            Console.WriteLine(err.ToString())
        End Try
    End Sub


    Shared Sub GetAllKeys()

        Try
            Dim config _
            As System.Configuration.Configuration = _
            ConfigurationManager.OpenExeConfiguration( _
            ConfigurationUserLevel.None)


            Dim sections _
            As ConfigurationSectionCollection = _
            config.Sections

            Dim key As String
            For Each key In sections.Keys
                Console.WriteLine("Key value: {0}", key)
            Next key


        Catch err As ConfigurationErrorsException
            Console.WriteLine(err.ToString())
        End Try
    End Sub



    Shared Sub Clear()

        Try
            Dim config _
            As System.Configuration.Configuration = _
            ConfigurationManager.OpenExeConfiguration( _
            ConfigurationUserLevel.None)

            config.Sections.Clear()

            config.Save( _
            ConfigurationSaveMode.Full)
        Catch err As ConfigurationErrorsException
            Console.WriteLine(err.ToString())
        End Try
    End Sub


    Shared Sub GetSection()

        Try
            Dim customSection _
            As CustomSection = _
            ConfigurationManager.GetSection( _
            "CustomSection")

            If customSection Is Nothing Then
                Console.WriteLine("Failed to load CustomSection.")
            Else
                ' Display section information
                Console.WriteLine("Defaults:")
                Console.WriteLine("File Name:       {0}", _
                customSection.FileName)
                Console.WriteLine("Max Users:       {0}", _
                customSection.MaxUsers)
                Console.WriteLine("Max Idle Time:   {0}", _
                customSection.MaxIdleTime)
            End If


        Catch err As ConfigurationErrorsException
            Console.WriteLine(err.ToString())
        End Try
    End Sub

    Shared Sub GetEnumerator()

        Try
            Dim config _
            As System.Configuration.Configuration = _
            ConfigurationManager.OpenExeConfiguration( _
            ConfigurationUserLevel.None)

            Dim sections _
            As ConfigurationSectionCollection = _
            config.Sections

            Dim secEnum _
            As IEnumerator = sections.GetEnumerator()

            Dim i As Integer = 0
            While secEnum.MoveNext()
                Dim setionName _
                As String = sections.GetKey(i)
                Console.WriteLine( _
                "Section name: {0}", setionName)
                i += 1
            End While
        Catch err As ConfigurationErrorsException
            Console.WriteLine(err.ToString())
        End Try
    End Sub


    Shared Sub GetKeys()

        Try
            Dim config _
            As System.Configuration.Configuration = _
            ConfigurationManager.OpenExeConfiguration( _
            ConfigurationUserLevel.None)

            Dim sections _
            As ConfigurationSectionCollection = _
            config.Sections


            Dim key As String
            For Each key In sections.Keys


                Console.WriteLine("Key value: {0}", key)
            Next key


        Catch err As ConfigurationErrorsException
            Console.WriteLine(err.ToString())
        End Try
    End Sub


    Shared Sub GetItems()

        Try
            Dim config _
            As System.Configuration.Configuration = _
            ConfigurationManager.OpenExeConfiguration( _
            ConfigurationUserLevel.None)

            Dim sections _
            As ConfigurationSectionCollection = _
            config.Sections


            Dim section1 As ConfigurationSection = _
            sections.Item("runtime")

            Dim section2 As ConfigurationSection = _
            sections.Item(0)

            Console.WriteLine("Section1: {0}", _
            section1.SectionInformation.Name)

            Console.WriteLine("Section2: {0}", _
            section2.SectionInformation.Name)

        Catch err As ConfigurationErrorsException
            Console.WriteLine(err.ToString())
        End Try
    End Sub


    Shared Sub Remove()

        Try
            Dim config _
            As System.Configuration.Configuration = _
            ConfigurationManager.OpenExeConfiguration( _
            ConfigurationUserLevel.None)

            Dim customSection As CustomSection = _
            config.GetSection("CustomSection")


            If Not (customSection Is Nothing) Then
                config.Sections.Remove("CustomSection")
                customSection.SectionInformation.ForceSave = True
                config.Save(ConfigurationSaveMode.Full)
            Else
                Console.WriteLine( _
                "CustomSection does not exists.")
            End If

        Catch err As ConfigurationErrorsException
            Console.WriteLine(err.ToString())
        End Try
    End Sub


    Shared Sub AddSection()

        Try
            Dim config _
            As System.Configuration.Configuration = _
            ConfigurationManager.OpenExeConfiguration( _
            ConfigurationUserLevel.None)

            Dim customSection _
            As New CustomSection()


            Dim index As String = _
            config.Sections.Count.ToString()

            customSection.FileName = _
            "newFile" + index + ".txt"

            Dim sectionName As String = _
            "CustomSection" + index

            Dim ts As New TimeSpan(0, 15, 0)
            customSection.MaxIdleTime = ts
            customSection.MaxUsers = 100

            config.Sections.Add(sectionName, customSection)
            customSection.SectionInformation.ForceSave = True
            config.Save(ConfigurationSaveMode.Full)
        Catch err As ConfigurationErrorsException
            Console.WriteLine(err.ToString())
        End Try
    End Sub



    ' Exercise the collection.
    ' Uncomment the function you want to exercise.
    ' Start with CreateSection().
    Public Overloads Shared Sub Main(ByVal args() As String)
        CreateSection()
        ' AddSection()
        ' GetSection()
        ' GetEnumerator()
        ' GetAllKeys()
        ' GetKeys()
        GetItems()
        ' Clear()
        ' Remove()
    End Sub

End Class

次の例は、前の例で使用した構成ファイルの抜粋です。The following example is an excerpt of the configuration file used by the previous example.

<?xml version="1.0" encoding="utf-8"?>  
<configuration>  
  <configSections>  
  
    <section name="CustomSection"   
      type="Samples.AspNet.Configuration.CustomSection, ConfigurationSectionCollection, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" allowDefinition="Everywhere" allowExeDefinition="MachineToApplication" restartOnExternalChanges="true" />  
  
  </configSections>  
  
  <CustomSection fileName="default.txt" maxUsers="1000"   
    maxIdleTime="00:05:00" />  
  
</configuration>  

注釈

クラスをConfigurationSectionCollection使用して、オブジェクトのConfigurationSectionコレクションを反復処理します。Use the ConfigurationSectionCollection class to iterate through a collection of ConfigurationSection objects. このオブジェクトのコレクションにSections Sectionsは、プロパティまたはプロパティを使用してアクセスできます。You can access this collection of objects using the Sections property or the Sections property.

クラスは、 ConfigurationSectionクラスを拡張するカスタム型の作成にも使用されます。 ConfigurationSectionCollectionThe ConfigurationSectionCollection class is also used in the creation of custom types that extend the ConfigurationSection class.

プロパティ

Count

この ConfigurationSectionCollection オブジェクト内のセクションの数を取得します。Gets the number of sections in this ConfigurationSectionCollection object.

IsReadOnly

NameObjectCollectionBase インスタンスが読み取り専用かどうかを示す値を取得または設定します。Gets or sets a value indicating whether the NameObjectCollectionBase instance is read-only.

(継承元 NameObjectCollectionBase)
Item[Int32]

指定した ConfigurationSection オブジェクトを取得します。Gets the specified ConfigurationSection object.

Item[String]

指定した ConfigurationSection オブジェクトを取得します。Gets the specified ConfigurationSection object.

Keys

この ConfigurationSection オブジェクトに格納されているすべての ConfigurationSectionCollection オブジェクトに対するキーを取得します。Gets the keys to all ConfigurationSection objects contained in this ConfigurationSectionCollection object.

メソッド

Add(String, ConfigurationSection)

ConfigurationSectionCollection オブジェクトに ConfigurationSection オブジェクトを追加します。Adds a ConfigurationSection object to the ConfigurationSectionCollection object.

BaseAdd(String, Object)

指定したキーと値を持つエントリを NameObjectCollectionBase インスタンスに追加します。Adds an entry with the specified key and value into the NameObjectCollectionBase instance.

(継承元 NameObjectCollectionBase)
BaseClear()

NameObjectCollectionBase インスタンスからすべてのエントリを削除します。Removes all entries from the NameObjectCollectionBase instance.

(継承元 NameObjectCollectionBase)
BaseGet(Int32)

NameObjectCollectionBase インスタンスの指定したインデックスにあるエントリの値を取得します。Gets the value of the entry at the specified index of the NameObjectCollectionBase instance.

(継承元 NameObjectCollectionBase)
BaseGet(String)

NameObjectCollectionBase インスタンスから、指定したキーを持つ最初のエントリの値を取得します。Gets the value of the first entry with the specified key from the NameObjectCollectionBase instance.

(継承元 NameObjectCollectionBase)
BaseGetAllKeys()

NameObjectCollectionBase インスタンス内のすべてのキーを格納する String 配列を返します。Returns a String array that contains all the keys in the NameObjectCollectionBase instance.

(継承元 NameObjectCollectionBase)
BaseGetAllValues()

NameObjectCollectionBase インスタンス内のすべての値を格納する Object 配列を返します。Returns an Object array that contains all the values in the NameObjectCollectionBase instance.

(継承元 NameObjectCollectionBase)
BaseGetAllValues(Type)

NameObjectCollectionBase インスタンス内のすべての値を格納する、指定した型の配列を返します。Returns an array of the specified type that contains all the values in the NameObjectCollectionBase instance.

(継承元 NameObjectCollectionBase)
BaseGetKey(Int32)

NameObjectCollectionBase インスタンスの指定したインデックスにあるエントリのキーを取得します。Gets the key of the entry at the specified index of the NameObjectCollectionBase instance.

(継承元 NameObjectCollectionBase)
BaseHasKeys()

NameObjectCollectionBase インスタンスが、キーが null ではないエントリを格納しているかどうかを示す値を取得します。Gets a value indicating whether the NameObjectCollectionBase instance contains entries whose keys are not null.

(継承元 NameObjectCollectionBase)
BaseRemove(String)

指定したキーを持つエントリを NameObjectCollectionBase インスタンスから削除します。Removes the entries with the specified key from the NameObjectCollectionBase instance.

(継承元 NameObjectCollectionBase)
BaseRemoveAt(Int32)

NameObjectCollectionBase インスタンスの指定したインデックスにあるエントリを削除します。Removes the entry at the specified index of the NameObjectCollectionBase instance.

(継承元 NameObjectCollectionBase)
BaseSet(Int32, Object)

NameObjectCollectionBase インスタンスの指定したインデックスにあるエントリの値を設定します。Sets the value of the entry at the specified index of the NameObjectCollectionBase instance.

(継承元 NameObjectCollectionBase)
BaseSet(String, Object)

NameObjectCollectionBase インスタンス内に指定したキーを持つエントリが存在する場合は、その最初のエントリの値を設定します。存在しない場合は、指定したキーと値を持つエントリを NameObjectCollectionBase インスタンスに追加します。Sets the value of the first entry with the specified key in the NameObjectCollectionBase instance, if found; otherwise, adds an entry with the specified key and value into the NameObjectCollectionBase instance.

(継承元 NameObjectCollectionBase)
Clear()

この ConfigurationSectionCollection オブジェクトをクリアします。Clears this ConfigurationSectionCollection object.

CopyTo(ConfigurationSection[], Int32)

この ConfigurationSectionCollection オブジェクトを配列にコピーします。Copies this ConfigurationSectionCollection object to an array.

Equals(Object)

指定したオブジェクトが、現在のオブジェクトと等しいかどうかを判断します。Determines whether the specified object is equal to the current object.

(継承元 Object)
Get(Int32)

この ConfigurationSection オブジェクトに格納されている、指定した ConfigurationSectionCollection オブジェクトを取得します。Gets the specified ConfigurationSection object contained in this ConfigurationSectionCollection object.

Get(String)

この ConfigurationSection オブジェクトに格納されている、指定した ConfigurationSectionCollection オブジェクトを取得します。Gets the specified ConfigurationSection object contained in this ConfigurationSectionCollection object.

GetEnumerator()

この ConfigurationSectionCollection オブジェクトを反復処理できる列挙子を取得します。Gets an enumerator that can iterate through this ConfigurationSectionCollection object.

GetHashCode()

既定のハッシュ関数として機能します。Serves as the default hash function.

(継承元 Object)
GetKey(Int32)

この ConfigurationSection オブジェクトに格納されている、指定した ConfigurationSectionCollection オブジェクトのキーを取得します。Gets the key of the specified ConfigurationSection object contained in this ConfigurationSectionCollection object.

GetObjectData(SerializationInfo, StreamingContext)

シリアル化中にシステムにより使用されます。Used by the system during serialization.

GetType()

現在のインスタンスの Type を取得します。Gets the Type of the current instance.

(継承元 Object)
MemberwiseClone()

現在の Object の簡易コピーを作成します。Creates a shallow copy of the current Object.

(継承元 Object)
OnDeserialization(Object)

ISerializable インターフェイスを実装し、逆シリアル化が完了したときに逆シリアル化イベントを発生させます。Implements the ISerializable interface and raises the deserialization event when the deserialization is complete.

(継承元 NameObjectCollectionBase)
Remove(String)

指定した ConfigurationSection オブジェクトを、この ConfigurationSectionCollection オブジェクトから削除します。Removes the specified ConfigurationSection object from this ConfigurationSectionCollection object.

RemoveAt(Int32)

指定した ConfigurationSection オブジェクトを、この ConfigurationSectionCollection オブジェクトから削除します。Removes the specified ConfigurationSection object from this ConfigurationSectionCollection object.

ToString()

現在のオブジェクトを表す文字列を返します。Returns a string that represents the current object.

(継承元 Object)

明示的なインターフェイスの実装

ICollection.CopyTo(Array, Int32)

NameObjectCollectionBase 全体を、互換性のある 1 次元の Array にコピーします。コピー操作は、コピー先の配列の指定したインデックスから始まる部分に行います。Copies the entire NameObjectCollectionBase to a compatible one-dimensional Array, starting at the specified index of the target array.

(継承元 NameObjectCollectionBase)
ICollection.IsSynchronized

NameObjectCollectionBase オブジェクトへのアクセスが同期されている (スレッド セーフである) かどうかを示す値を取得します。Gets a value indicating whether access to the NameObjectCollectionBase object is synchronized (thread safe).

(継承元 NameObjectCollectionBase)
ICollection.SyncRoot

NameObjectCollectionBase オブジェクトへのアクセスを同期するために使用できるオブジェクトを取得します。Gets an object that can be used to synchronize access to the NameObjectCollectionBase object.

(継承元 NameObjectCollectionBase)

拡張メソッド

Cast<TResult>(IEnumerable)

IEnumerable の要素を、指定した型にキャストします。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

指定された型に基づいて IEnumerable の要素をフィルター処理します。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

クエリの並列化を有効にします。Enables parallelization of a query.

AsQueryable(IEnumerable)

IEnumerableIQueryable に変換します。Converts an IEnumerable to an IQueryable.

適用対象

こちらもご覧ください