Export (0) Print
Expand All

ConfigurationPropertyCollection Class

Note: This class is new in the .NET Framework version 2.0.

Represents a collection of configuration-element properties.

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

public class ConfigurationPropertyCollection : ICollection, IEnumerable
public class ConfigurationPropertyCollection implements ICollection, IEnumerable
public class ConfigurationPropertyCollection implements ICollection, IEnumerable

The ConfigurationPropertyCollection class represents the collection of the ConfigurationProperty objects that can be attributes or ConfigurationElement objects of a configuration element.

The ConfigurationProperty class represents an individual configuration setting. It allows you to get or set the name, type, and default value for a particular configuration entity (attribute or element). Additional options allow you to specify whether the attribute is required, is an element key, or represents a default element collection.

The following example shows one possible use of the ConfigurationPropertyCollection. Refer to the example of the related type ConfigurationProperty.

// Return the initialized property bag
// for the configuration element.
// The collection (property bag) that contains 
// the properties is declared as:
// ConfigurationPropertyCollection _Properties;
protected override ConfigurationPropertyCollection Properties
{
    get
    {
        return _Properties;
    


The following is an excerpt from the configuration used by the above example.

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

System.Object
  System.Configuration.ConfigurationPropertyCollection

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

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft