ConfigurationElementCollection.BaseGet Metoda

Definicja

Pobiera obiekt ConfigurationElement w określonej lokalizacji indeksu.

Przeciążenia

BaseGet(Int32)

Pobiera element konfiguracji w określonej lokalizacji indeksu.

BaseGet(Object)

Zwraca element konfiguracji z określonym kluczem.

BaseGet(Int32)

Źródło:
ConfigurationElementCollection.cs
Źródło:
ConfigurationElementCollection.cs
Źródło:
ConfigurationElementCollection.cs

Pobiera element konfiguracji w określonej lokalizacji indeksu.

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

Parametry

index
Int32

Lokalizacja indeksu do ConfigurationElement zwrócenia.

Zwraca

Element ConfigurationElement w określonym indeksie.

Wyjątki

index wartość jest mniejsza niż 0.

-lub-

Nie ma ConfigurationElement określonej wartości index.

Przykłady

W poniższym przykładzie kodu pokazano, jak wywołać metodę BaseGet .

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

Dotyczy

BaseGet(Object)

Źródło:
ConfigurationElementCollection.cs
Źródło:
ConfigurationElementCollection.cs
Źródło:
ConfigurationElementCollection.cs

Zwraca element konfiguracji z określonym kluczem.

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

Parametry

key
Object

Klucz elementu do zwrócenia.

Zwraca

Element ConfigurationElement z określonym kluczem; w przeciwnym razie null.

Przykłady

W poniższym przykładzie kodu pokazano, jak wywołać metodę BaseGet .

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

Uwagi

Metoda BaseGet zwraca null wartość , jeśli w kolekcji nie ConfigurationElement ma obiektu o określonym kluczu.

Dotyczy