ConfigurationElementCollection.BaseGet Method (Int32)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the configuration element at the specified index location.

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

protected internal ConfigurationElement BaseGet(
	int index
)

Parameters

index
Type: System.Int32

The index location of the ConfigurationElement to return.

Return Value

Type: System.Configuration.ConfigurationElement

The ConfigurationElement at the specified index.

Exception Condition
ConfigurationErrorsException

index is less than 0.

- or -

There is no ConfigurationElement at the specified index.

The following code example shows how to call the BaseGet method.

public UrlConfigElement this[int index]
{
    get
    {
        return (UrlConfigElement)BaseGet(index);
    }
    set
    {
        if (BaseGet(index) != null)
        {
            BaseRemoveAt(index);
        }
        BaseAdd(index, value);
    }
}

.NET Framework
Available since 2.0
Return to top
Show: