ConfigurationElementCollection.BaseGet Method

Definition

Ruft das ConfigurationElement an der angegebenen Indexposition ab.Gets the ConfigurationElement at the specified index location.

Overloads

BaseGet(Int32)

Ruft das Konfigurationselement am angegebenen Index ab.Gets the configuration element at the specified index location.

BaseGet(Object)

Gibt das Konfigurationselement mit dem angegebenen Schlüssel zurück.Returns the configuration element with the specified key.

BaseGet(Int32)

Ruft das Konfigurationselement am angegebenen Index ab.Gets the configuration element at the specified index location.

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

Parameters

index
Int32

Die Indexposition des zurückzugebenden ConfigurationElement.The index location of the ConfigurationElement to return.

Returns

ConfigurationElement

Das ConfigurationElement-Objekt am angegebenen Index.The ConfigurationElement at the specified index.

Exceptions

index ist kleiner als 0.index is less than 0.

Oder-or- Am angegebenen ConfigurationElement ist kein index vorhanden.There is no ConfigurationElement at the specified index.

Examples

Im folgenden Codebeispiel wird gezeigt, wie die BaseGet-Methode aufgerufen wird.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)

Gibt das Konfigurationselement mit dem angegebenen Schlüssel zurück.Returns the configuration element with the specified key.

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

Parameters

key
Object

Der Schlüssel des zurückzugebenden Elements.The key of the element to return.

Returns

ConfigurationElement

Das ConfigurationElement mit dem angegebenen Schlüssel, andernfalls null.The ConfigurationElement with the specified key; otherwise, null.

Examples

Im folgenden Codebeispiel wird gezeigt, wie die BaseGet-Methode aufgerufen wird.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

Die BaseGet-Methode gibt null zurück, wenn kein ConfigurationElement-Objekt mit dem angegebenen Schlüssel in der Auflistung vorhanden ist.The BaseGet method returns null if there is no ConfigurationElement object with the specified key in the collection.

Applies to