ConfigurationElementCollection.BaseGet ConfigurationElementCollection.BaseGet ConfigurationElementCollection.BaseGet ConfigurationElementCollection.BaseGet Method

Definition

Gets the ConfigurationElement at the specified index location.

Overloads

BaseGet(Int32) BaseGet(Int32) BaseGet(Int32) BaseGet(Int32)

Gets the configuration element at the specified index location.

BaseGet(Object) BaseGet(Object) BaseGet(Object) BaseGet(Object)

Returns the configuration element with the specified key.

BaseGet(Int32) BaseGet(Int32) BaseGet(Int32) BaseGet(Int32)

Gets the configuration element at the specified index location.

protected public:
 System::Configuration::ConfigurationElement ^ BaseGet(int index);
protected internal System.Configuration.ConfigurationElement BaseGet (int index);
member this.BaseGet : int -> System.Configuration.ConfigurationElement
Protected Friend Function BaseGet (index As Integer) As ConfigurationElement

Parameters

index
Int32 Int32 Int32 Int32

The index location of the ConfigurationElement to return.

Returns

Exceptions

Examples

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);
    }
}
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

BaseGet(Object) BaseGet(Object) BaseGet(Object) BaseGet(Object)

Returns the configuration element with the specified key.

protected public:
 System::Configuration::ConfigurationElement ^ BaseGet(System::Object ^ key);
protected internal System.Configuration.ConfigurationElement BaseGet (object key);
member this.BaseGet : obj -> System.Configuration.ConfigurationElement
Protected Friend Function BaseGet (key As Object) As ConfigurationElement

Parameters

key
Object Object Object Object

The key of the element to return.

Returns

Examples

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

new public UrlConfigElement this[string Name]
{
    get
    {
        return (UrlConfigElement)BaseGet(Name);
    }
}
Default Public Shadows ReadOnly Property Item(ByVal Name As String) As UrlConfigElement
    Get
        Return CType(BaseGet(Name), UrlConfigElement)
    End Get
End Property

Remarks

The BaseGet method returns null if there is no ConfigurationElement object with the specified key in the collection.

Applies to