Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

ConfigurationSectionGroupCollection Class

Represents a collection of ConfigurationSectionGroup objects.

System::Object
  System.Collections.Specialized::NameObjectCollectionBase
    System.Configuration::ConfigurationSectionGroupCollection

Namespace:  System.Configuration
Assembly:  System.Configuration (in System.Configuration.dll)

[SerializableAttribute]
public ref class ConfigurationSectionGroupCollection sealed : public NameObjectCollectionBase

The ConfigurationSectionGroupCollection type exposes the following members.

  NameDescription
Public propertyCountGets the number of section groups in the collection. (Overrides NameObjectCollectionBase::Count.)
Public propertyItem[Int32]Gets the ConfigurationSectionGroup object whose index is specified from the collection.
Public propertyItem[String]Gets the ConfigurationSectionGroup object whose name is specified from the collection.
Public propertyKeysGets the keys to all ConfigurationSectionGroup objects contained in this ConfigurationSectionGroupCollection object. (Overrides NameObjectCollectionBase::Keys.)
Top

  NameDescription
Public methodAddAdds a ConfigurationSectionGroup object to this ConfigurationSectionGroupCollection object.
Public methodClearClears the collection.
Public methodCopyToCopies this ConfigurationSectionGroupCollection object to an array.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodGet(Int32)Gets the specified ConfigurationSectionGroup object contained in the collection.
Public methodGet(String)Gets the specified ConfigurationSectionGroup object from the collection.
Public methodGetEnumeratorGets an enumerator that can iterate through the ConfigurationSectionGroupCollection object. (Overrides NameObjectCollectionBase::GetEnumerator().)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetKeyGets the key of the specified ConfigurationSectionGroup object contained in this ConfigurationSectionGroupCollection object.
Public methodGetObjectDataUsed by the system during serialization. (Overrides NameObjectCollectionBase::GetObjectData(SerializationInfo, StreamingContext).)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodOnDeserializationImplements the ISerializable interface and raises the deserialization event when the deserialization is complete. (Inherited from NameObjectCollectionBase.)
Public methodRemoveRemoves the ConfigurationSectionGroup object whose name is specified from this ConfigurationSectionGroupCollection object.
Public methodRemoveAtRemoves the ConfigurationSectionGroup object whose index is specified from this ConfigurationSectionGroupCollection object.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Explicit interface implemetationPrivate methodICollection::CopyToCopies the entire NameObjectCollectionBase to a compatible one-dimensional Array, starting at the specified index of the target array. (Inherited from NameObjectCollectionBase.)
Explicit interface implemetationPrivate propertyICollection::IsSynchronizedGets a value indicating whether access to the NameObjectCollectionBase object is synchronized (thread safe). (Inherited from NameObjectCollectionBase.)
Explicit interface implemetationPrivate propertyICollection::SyncRootGets an object that can be used to synchronize access to the NameObjectCollectionBase object. (Inherited from NameObjectCollectionBase.)
Top

Use the ConfigurationSectionGroupCollection class to iterate through a collection of ConfigurationSectionGroup objects. You can access this collection of objects using the SectionGroups property or the SectionGroups property.

The ConfigurationSectionGroupCollection class is also used in the creation of custom types that extend the ConfigurationSectionGroup class.

The following code example shows how to use the ConfigurationSectionGroupCollection class.

No code example is currently available or this language may not be supported.

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>

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2015 Microsoft