ConfigurationElementCollection.CreateNewElement Method ()

When overridden in a derived class, creates a new ConfigurationElement.

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

protected abstract ConfigurationElement CreateNewElement ()
protected abstract ConfigurationElement CreateNewElement ()
protected abstract function CreateNewElement () : ConfigurationElement
Not applicable.

Return Value

A new ConfigurationElement.

Override the CreateNewElement method to create custom ConfigurationElement objects of a specific type. When a collection is loaded from the configuration file, CreateNewElement is called to create individual elements. CreateNewElement must be overridden in classes that derive from the ConfigurationElementCollection class.

The following code example shows how to override the CreateNewElement method.

protected override 
    ConfigurationElement CreateNewElement()
    return new UrlConfigElement();

Windows 98, Windows Server 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 Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions