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 Friend Function BaseGet (
	index As Integer
) As ConfigurationElement

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.

Default Public Shadows Property Item(ByVal index As Integer) As UrlConfigElement
    Get
        Return CType(BaseGet(index), UrlConfigElement)
    End Get
    Set(ByVal value As UrlConfigElement)
        If BaseGet(index) IsNot Nothing Then
            BaseRemoveAt(index)
        End If
        BaseAdd(value)
    End Set
End Property

.NET Framework
Available since 2.0
Return to top
Show: