ConfigurationSectionGroupCollection Klasse

Definition

Stellt eine Auflistung vonConfigurationSectionGroup-Objekten dar.Represents a collection of ConfigurationSectionGroup objects.

public ref class ConfigurationSectionGroupCollection sealed : System::Collections::Specialized::NameObjectCollectionBase
[System.Serializable]
public sealed class ConfigurationSectionGroupCollection : System.Collections.Specialized.NameObjectCollectionBase
type ConfigurationSectionGroupCollection = class
    inherit NameObjectCollectionBase
Public NotInheritable Class ConfigurationSectionGroupCollection
Inherits NameObjectCollectionBase
Vererbung
ConfigurationSectionGroupCollection
Attribute

Beispiele

Im folgenden Codebeispiel wird die Verwendung der ConfigurationSectionGroupCollection-Klasse veranschaulicht.The following code example shows how to use the ConfigurationSectionGroupCollection class.

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

namespace Samples.Config
{


    // Define a custom section.
    public sealed class CustomSection :
        ConfigurationSection
    {

        public CustomSection()
        { }

        [ConfigurationProperty("fileName", DefaultValue = "default.txt",
            IsRequired = true, IsKey = false)]
        [StringValidator(InvalidCharacters = " ~!@#$%^&*()[]{}/;'\"|\\",
            MinLength = 1, MaxLength = 60)]
        public string FileName
        {
            get
            {
                return (string)this["fileName"];
            }
            set
            {
                this["fileName"] = value;
            }
        }
      
        [ConfigurationProperty("maxUsers", DefaultValue = (long)10000,
            IsRequired = false)]
        [LongValidator(MinValue = 1, MaxValue = 10000000,
            ExcludeRange = false)]
        public long MaxUsers
        {
            get
            {
                return (long)this["maxUsers"];
            }
            set
            {
                this["maxUsers"] = value;
            }
        }
       
        [ConfigurationProperty("maxIdleTime",
            DefaultValue = "0:10:0",
            IsRequired = false)]
        [TimeSpanValidator(MinValueString = "0:0:30",
            MaxValueString = "5:00:0",
            ExcludeRange = false)]
        public TimeSpan MaxIdleTime
        {
            get
            {
                return (TimeSpan)this["maxIdleTime"];
            }
            set
            {
                this["maxIdleTime"] = value;
            }
        }
       
    }

    // Define a custom section group.
    public sealed class CustomSectionGroup :
        ConfigurationSectionGroup
    {

        public CustomSectionGroup()
        {
            
        }

        public CustomSection Custom
        {
            get { return (CustomSection) 
                Sections.Get("CustomSection");}
        }

    }

    class UsingCustomSectionGroupCollection
    {

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

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

                // Create the section group entry  
                // in the <configSections> and the 
                // related target section in <configuration>.
                if (config.SectionGroups["CustomGroup"] == null)
                {
                    customSectionGroup = new CustomSectionGroup();
                    config.SectionGroups.Add("CustomGroup", 
                        customSectionGroup);
                    customSectionGroup.ForceDeclaration(true);
                    config.Save(ConfigurationSaveMode.Full);
                }

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

        }

        // Get the collection group keys i.e.,
        // the group names.
        //static void GetAllKeys()
        //{

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

        //        ConfigurationSectionGroupCollection groups =
        //            config.SectionGroups;
        //        groups.
        //        foreach (string name in groups.AllKeys)
        //        {
        //            Console.WriteLine(
        //             "Key value: {0}", name);
        //        }


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

        static void Clear()
        {

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

                config.SectionGroups.Clear();

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

        static void GetGroup()
        {

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

                ConfigurationSectionGroup customGroup =
                    config.SectionGroups.Get("CustomGroup");


                if (customGroup == null)
                    Console.WriteLine(
                        "Failed to load CustomSection.");
                else
                {
                    // Display section information
                    Console.WriteLine("Section group name:       {0}",
                        customGroup.SectionGroupName);
                    Console.WriteLine("Name:       {0}",
                        customGroup.Name);
                    Console.WriteLine("Type:   {0}",
                        customGroup.Type);

                }

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

        static void GetEnumerator()
        {

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

                ConfigurationSectionGroupCollection groups =
                    config.SectionGroups;

                IEnumerator groupEnum =
                    groups.GetEnumerator();

                int i = 0;
                while (groupEnum.MoveNext())
                {
                    string groupName = groups.GetKey(i);
                    Console.WriteLine(
                        "Group name: {0}", groupName);
                    i += 1;
                }
            }
            catch (ConfigurationErrorsException err)
            {
                Console.WriteLine(err.ToString());
            }
        }


        // Get the collection keys i.e., the
        // group names.
        static void GetKeys()
        {

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

                ConfigurationSectionGroupCollection groups =
                    config.SectionGroups;

                foreach (string key in groups.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);

                ConfigurationSectionGroupCollection groups =
                    config.SectionGroups;

                ConfigurationSectionGroup group1 =
                    groups.Get("system.net");

                ConfigurationSectionGroup group2 =
                groups.Get("system.web");


                Console.WriteLine(
                     "Group1: {0}", group1.Name);

                Console.WriteLine(
                    "Group2: {0}", group2.Name);

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


        static void Remove()
        {

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

                ConfigurationSectionGroup customGroup =
                    config.SectionGroups.Get("CustomGroup");

                if (customGroup != null)
                {
                    config.SectionGroups.Remove("CustomGroup");
                    config.Save(ConfigurationSaveMode.Full);
                }
                else
                    Console.WriteLine(
                        "CustomGroup does not exists.");

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



        // Add custom section to the group.
        static void AddSection()
        {
            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>.
                ConfigurationSectionGroup customGroup;
                customGroup = config.SectionGroups.Get("CustomGroup");

                if (customGroup.Sections.Get("CustomSection") == null)
                {
                    customSection = new CustomSection();
                    customGroup.Sections.Add("CustomSection",
                        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 CreateSectionGroup().
        static void Main(string[] args)
        {
            CreateSectionGroup();
            AddSection();
            // GetAllKeys();
            // GetGroup();
            
            // GetEnumerator();
            
            // GetKeys();
            
            // GetItems();

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


    }
}
Imports System.Configuration
Imports System.Collections


' Define a custom section.
NotInheritable Public Class CustomSection
   Inherits ConfigurationSection
   
   
   Public Sub New()
   End Sub
   
    <ConfigurationProperty("fileName", _
    DefaultValue:="default.txt", _
    IsRequired:=True, _
    IsKey:=False), _
    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

    <ConfigurationProperty("maxUsers", _
    DefaultValue:=10000, _
    IsRequired:=False), _
    LongValidator(MinValue:=1, _
    MaxValue:=10000000, _
    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

    <ConfigurationProperty("maxIdleTime", _
    DefaultValue:="0:10:0", _
    IsRequired:=False), _
    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

' Define a custom section group.

NotInheritable Public Class CustomSectionGroup
   Inherits ConfigurationSectionGroup
   
   
   Public Sub New()
   End Sub

   
   Public ReadOnly Property Custom() As CustomSection
      Get
            Return CType(Sections.Get("CustomSection"), _
            CustomSection)
      End Get
    End Property

End Class


Class UsingCustomSectionGroupCollection

   
   ' Create a custom section group.
   Shared Sub CreateSectionGroup()
      Try
         
         Dim customSectionGroup As CustomSectionGroup
         
         ' Get the current configuration file.
            Dim config As System.Configuration.Configuration = _
            ConfigurationManager.OpenExeConfiguration( _
            ConfigurationUserLevel.None)
         
         ' Create the section group entry  
         ' in the <configSections> and the 
         ' related target section in <configuration>.
         If config.SectionGroups("CustomGroup") Is Nothing Then
            customSectionGroup = New CustomSectionGroup()
            config.SectionGroups.Add("CustomGroup", customSectionGroup)
            customSectionGroup.ForceDeclaration(True)
            config.Save(ConfigurationSaveMode.Full)
         End If
      
      Catch err As ConfigurationErrorsException
         Console.WriteLine(err.ToString())
      End Try
   End Sub
    
   
   ' Get the collection group keys i.e.,
   ' the group names.
    'Shared Sub GetAllKeys()

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

    '         Dim groups _
    '         As ConfigurationSectionGroupCollection = _
    '         config.SectionGroups

    '      Dim name As String
    '      For Each name In  groups.AllKeys
    '         Console.WriteLine("Key value: {0}", name)
    '      Next name


    '   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.SectionGroups.Clear()
         
         config.Save(ConfigurationSaveMode.Full)
      Catch err As ConfigurationErrorsException
         Console.WriteLine(err.ToString())
      End Try
   End Sub
   

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

            Dim groups _
            As ConfigurationSectionGroupCollection = _
            config.SectionGroups

            Dim customGroup _
            As ConfigurationSectionGroup = _
            groups.Get("CustomGroup")
         
         
         If customGroup Is Nothing Then
                Console.WriteLine( _
                "Failed to load CustomGroup.")
         Else
            ' Display section information
                Console.WriteLine("Name:       {0}", _
                customGroup.Name)
                Console.WriteLine("Type:   {0}", _
                customGroup.Type)
         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 groups _
            As ConfigurationSectionGroupCollection = _
            config.SectionGroups

            Dim groupEnum As IEnumerator = _
            groups.GetEnumerator()
         
         Dim i As Integer = 0
         While groupEnum.MoveNext()
            Dim groupName As String = groups.GetKey(i)
            Console.WriteLine("Group name: {0}", groupName)
            i += 1
         End While

      Catch err As ConfigurationErrorsException
         Console.WriteLine(err.ToString())
      End Try
   End Sub
   
   
   ' Get the collection keys i.e., the
   ' group names.
   Shared Sub GetKeys()
      
      Try
            Dim config _
          As System.Configuration.Configuration = _
          ConfigurationManager.OpenExeConfiguration( _
          ConfigurationUserLevel.None)

            Dim groups _
            As ConfigurationSectionGroupCollection = _
            config.SectionGroups

         Dim key As String
         For Each key In  groups.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 groups _
            As ConfigurationSectionGroupCollection = _
            config.SectionGroups

            Dim group1 As ConfigurationSectionGroup = _
            groups.Get("system.net")
         
            Dim group2 As ConfigurationSectionGroup = _
            groups.Get("system.web")
         
         
         Console.WriteLine("Group1: {0}", group1.Name)
         
         Console.WriteLine("Group2: {0}", group2.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 groups _
            As ConfigurationSectionGroupCollection = _
            config.SectionGroups

            Dim customGroup _
            As ConfigurationSectionGroup = groups.Get("CustomGroup")
         
         If Not (customGroup Is Nothing) Then
            config.SectionGroups.Remove("CustomGroup")
            config.Save(ConfigurationSaveMode.Full)
         Else
                Console.WriteLine( _
                "CustomGroup does not exists.")
         End If
      
      Catch err As ConfigurationErrorsException
         Console.WriteLine(err.ToString())
      End Try
   End Sub
   
   
   
   ' Add custom section to the group.
   Shared Sub AddSection()
      Try
         
         Dim customSection As CustomSection
         
         ' Get the current configuration file.
            Dim config _
     As System.Configuration.Configuration = _
     ConfigurationManager.OpenExeConfiguration( _
     ConfigurationUserLevel.None)

            Dim groups _
            As ConfigurationSectionGroupCollection = _
            config.SectionGroups

         ' Create the section entry  
         ' in the <configSections> and the 
         ' related target section in <configuration>.
         Dim customGroup As ConfigurationSectionGroup
            customGroup = groups.Get("CustomGroup")
         
            If customGroup.Sections.Get( _
            "CustomSection") Is Nothing Then
                customSection = New CustomSection()
                customGroup.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
   
   
   ' Exercise the collection.
   ' Uncomment the function you want to exercise.
    ' Start with CreateSectionGroup().
    Public Overloads Shared Sub Main(ByVal args() As String)
        CreateSectionGroup()
        AddSection()
        ' GetEnumerator();
        ' GetKeys();
        ' GetItems();
        ' Remove();
        ' Clear();

    End Sub
End Class

Das folgende Beispiel ist ein Auszug aus der Konfigurationsdatei, die im vorherigen Beispiel verwendet wurde.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>  

Hinweise

Verwenden Sie die ConfigurationSectionGroupCollection-Klasse, um eine Auflistung von ConfigurationSectionGroup-Objekten zu durchlaufen.Use the ConfigurationSectionGroupCollection class to iterate through a collection of ConfigurationSectionGroup objects. Sie können auf diese Auflistung von Objekten mithilfe der SectionGroups-Eigenschaft oder der SectionGroups-Eigenschaft zugreifen.You can access this collection of objects using the SectionGroups property or the SectionGroups property.

Die ConfigurationSectionGroupCollection-Klasse wird auch bei der Erstellung von benutzerdefinierten Typen verwendet, die die ConfigurationSectionGroup-Klasse erweitern.The ConfigurationSectionGroupCollection class is also used in the creation of custom types that extend the ConfigurationSectionGroup class.

Eigenschaften

Count

Ruft die Anzahl der Abschnittsgruppen in der Auflistung ab.Gets the number of section groups in the collection.

IsReadOnly

Ruft einen Wert ab, der angibt, ob die NameObjectCollectionBase-Instanz schreibgeschützt ist, oder legt diesen fest.Gets or sets a value indicating whether the NameObjectCollectionBase instance is read-only.

(Geerbt von NameObjectCollectionBase)
Item[Int32]

Ruft das ConfigurationSectionGroup-Objekt aus der Auflistung ab, dessen Index angegeben ist.Gets the ConfigurationSectionGroup object whose index is specified from the collection.

Item[String]

Ruft das ConfigurationSectionGroup-Objekt aus der Auflistung ab, dessen Name angegeben ist.Gets the ConfigurationSectionGroup object whose name is specified from the collection.

Keys

Ruft die Schlüssel zu allen ConfigurationSectionGroup-Objekten ab, die in diesem ConfigurationSectionGroupCollection-Objekt enthalten sind.Gets the keys to all ConfigurationSectionGroup objects contained in this ConfigurationSectionGroupCollection object.

Methoden

Add(String, ConfigurationSectionGroup)

Fügt diesem ConfigurationSectionGroup-Objekt ein ConfigurationSectionGroupCollection-Objekt hinzu.Adds a ConfigurationSectionGroup object to this ConfigurationSectionGroupCollection object.

BaseAdd(String, Object)

Fügt einen Eintrag mit dem angegebenen Schlüssel und Wert der NameObjectCollectionBase-Instanz hinzu.Adds an entry with the specified key and value into the NameObjectCollectionBase instance.

(Geerbt von NameObjectCollectionBase)
BaseClear()

Entfernt alle Einträge aus der NameObjectCollectionBase-Instanz.Removes all entries from the NameObjectCollectionBase instance.

(Geerbt von NameObjectCollectionBase)
BaseGet(Int32)

Ruft den Wert des Eintrags am angegebenen Index der NameObjectCollectionBase-Instanz ab.Gets the value of the entry at the specified index of the NameObjectCollectionBase instance.

(Geerbt von NameObjectCollectionBase)
BaseGet(String)

Ruft den Wert des ersten Eintrags mit dem angegebenen Schlüssel aus der NameObjectCollectionBase-Instanz ab.Gets the value of the first entry with the specified key from the NameObjectCollectionBase instance.

(Geerbt von NameObjectCollectionBase)
BaseGetAllKeys()

Gibt ein String-Array zurück, das alle Schlüssel der NameObjectCollectionBase-Instanz enthält.Returns a String array that contains all the keys in the NameObjectCollectionBase instance.

(Geerbt von NameObjectCollectionBase)
BaseGetAllValues()

Gibt ein Object-Array zurück, das alle Werte der NameObjectCollectionBase-Instanz enthält.Returns an Object array that contains all the values in the NameObjectCollectionBase instance.

(Geerbt von NameObjectCollectionBase)
BaseGetAllValues(Type)

Gibt ein Array des angegebenen Typs zurück, das alle Werte der NameObjectCollectionBase-Instanz enthält.Returns an array of the specified type that contains all the values in the NameObjectCollectionBase instance.

(Geerbt von NameObjectCollectionBase)
BaseGetKey(Int32)

Ruft den Schlüssel des Eintrags am angegebenen Index der NameObjectCollectionBase-Instanz ab.Gets the key of the entry at the specified index of the NameObjectCollectionBase instance.

(Geerbt von NameObjectCollectionBase)
BaseHasKeys()

Ruft einen Wert ab, der angibt, ob die NameObjectCollectionBase-Instanz Einträge enthält, deren Schlüssel nicht null sind.Gets a value indicating whether the NameObjectCollectionBase instance contains entries whose keys are not null.

(Geerbt von NameObjectCollectionBase)
BaseRemove(String)

Entfernt die Einträge mit dem angegebenen Schlüssel aus der NameObjectCollectionBase-Instanz.Removes the entries with the specified key from the NameObjectCollectionBase instance.

(Geerbt von NameObjectCollectionBase)
BaseRemoveAt(Int32)

Entfernt den Eintrag am angegebenen Index der NameObjectCollectionBase-Instanz.Removes the entry at the specified index of the NameObjectCollectionBase instance.

(Geerbt von NameObjectCollectionBase)
BaseSet(Int32, Object)

Legt den Wert des Eintrags am angegebenen Index der NameObjectCollectionBase-Instanz fest.Sets the value of the entry at the specified index of the NameObjectCollectionBase instance.

(Geerbt von NameObjectCollectionBase)
BaseSet(String, Object)

Legt den Wert des ersten Eintrags mit dem angegebenen Schlüssel in der NameObjectCollectionBase-Instanz fest. Wenn der Schlüssel nicht vorhanden ist, wird der NameObjectCollectionBase-Instanz ein Eintrag mit dem angegebenen Wert und Schlüssel hinzugefügt.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.

(Geerbt von NameObjectCollectionBase)
Clear()

Löscht die Auflistung.Clears the collection.

CopyTo(ConfigurationSectionGroup[], Int32)

Kopiert dieses ConfigurationSectionGroupCollection-Objekt in ein Array.Copies this ConfigurationSectionGroupCollection object to an array.

Equals(Object)

Bestimmt, ob das angegebene Objekt mit dem aktuellen Objekt identisch ist.Determines whether the specified object is equal to the current object.

(Geerbt von Object)
Get(Int32)

Ruft das angegebene ConfigurationSectionGroup-Objekt in der Auflistung ab.Gets the specified ConfigurationSectionGroup object contained in the collection.

Get(String)

Ruft das angegebene ConfigurationSectionGroup-Objekt aus der Auflistung ab.Gets the specified ConfigurationSectionGroup object from the collection.

GetEnumerator()

Ruft einen Enumerator ab, der das ConfigurationSectionGroupCollection-Objekt durchlaufen kann.Gets an enumerator that can iterate through the ConfigurationSectionGroupCollection object.

GetHashCode()

Fungiert als Standardhashfunktion.Serves as the default hash function.

(Geerbt von Object)
GetKey(Int32)

Ruft den Schlüssel des angegebenen ConfigurationSectionGroup-Objekts ab, das in diesem ConfigurationSectionGroupCollection-Objekt enthalten ist.Gets the key of the specified ConfigurationSectionGroup object contained in this ConfigurationSectionGroupCollection object.

GetObjectData(SerializationInfo, StreamingContext)

Wird vom System während der Serialisierung verwendet.Used by the system during serialization.

GetType()

Ruft den Type der aktuellen Instanz ab.Gets the Type of the current instance.

(Geerbt von Object)
MemberwiseClone()

Erstellt eine flache Kopie des aktuellen Object.Creates a shallow copy of the current Object.

(Geerbt von Object)
OnDeserialization(Object)

Implementiert die ISerializable-Schnittstelle und löst das Deserialisierungsereignis aus, sobald die Deserialisierung abgeschlossen ist.Implements the ISerializable interface and raises the deserialization event when the deserialization is complete.

(Geerbt von NameObjectCollectionBase)
Remove(String)

Entfernt das ConfigurationSectionGroup-Objekt, dessen Name von diesem ConfigurationSectionGroupCollection-Objekt angegeben wird.Removes the ConfigurationSectionGroup object whose name is specified from this ConfigurationSectionGroupCollection object.

RemoveAt(Int32)

Entfernt das ConfigurationSectionGroup-Objekt, dessen Index von diesem ConfigurationSectionGroupCollection-Objekt angegeben wird.Removes the ConfigurationSectionGroup object whose index is specified from this ConfigurationSectionGroupCollection object.

ToString()

Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt.Returns a string that represents the current object.

(Geerbt von Object)

Explizite Schnittstellenimplementierungen

ICollection.CopyTo(Array, Int32)

Kopiert die gesamte NameObjectCollectionBase-Instanz in ein kompatibles eindimensionales Array, beginnend am angegebenen Index des Zielarrays.Copies the entire NameObjectCollectionBase to a compatible one-dimensional Array, starting at the specified index of the target array.

(Geerbt von NameObjectCollectionBase)
ICollection.IsSynchronized

Ruft einen Wert ab, der angibt, ob der Zugriff auf das NameObjectCollectionBase-Objekt synchronisiert (threadsicher) ist.Gets a value indicating whether access to the NameObjectCollectionBase object is synchronized (thread safe).

(Geerbt von NameObjectCollectionBase)
ICollection.SyncRoot

Ruft ein Objekt ab, mit dem der Zugriff auf das NameObjectCollectionBase-Objekt synchronisiert werden kann.Gets an object that can be used to synchronize access to the NameObjectCollectionBase object.

(Geerbt von NameObjectCollectionBase)

Erweiterungsmethoden

Cast<TResult>(IEnumerable)

Wandelt die Elemente eines IEnumerable in den angegebenen Typ umCasts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

Filtert die Elemente eines IEnumerable anhand eines angegebenen TypsFilters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

Ermöglicht die Parallelisierung einer Abfrage.Enables parallelization of a query.

AsQueryable(IEnumerable)

Konvertiert einen IEnumerable in einen IQueryable.Converts an IEnumerable to an IQueryable.

Gilt für:

Siehe auch