ConfigurationElementCollection.BaseGet Metoda
Definicja
Pobiera ConfigurationElement o określonej lokalizacji indeksu.Gets the ConfigurationElement at the specified index location.
Przeciążenia
BaseGet(Int32) |
Pobiera element konfiguracji w określonej lokalizacji indeksu.Gets the configuration element at the specified index location. |
BaseGet(Object) |
Zwraca element konfiguracji z określonym kluczem.Returns the configuration element with the specified key. |
BaseGet(Int32)
Pobiera element konfiguracji w określonej lokalizacji indeksu.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
Parametry
- index
- Int32
Lokalizacja indeksu ConfigurationElement do zwrócenia.The index location of the ConfigurationElement to return.
Zwraca
ConfigurationElementO określonym indeksie.The ConfigurationElement at the specified index.
Wyjątki
index
jest mniejsze niż 0
.index
is less than 0
.
-lub--or-
Nie ma ConfigurationElement określonego index
.There is no ConfigurationElement at the specified index
.
Przykłady
Poniższy przykład kodu pokazuje, jak wywołać BaseGet metodę.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
Dotyczy
BaseGet(Object)
Zwraca element konfiguracji z określonym kluczem.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
Parametry
- key
- Object
Klucz elementu do zwrócenia.The key of the element to return.
Zwraca
ConfigurationElementZ określonym kluczem; w przeciwnym razie, null
.The ConfigurationElement with the specified key; otherwise, null
.
Przykłady
Poniższy przykład kodu pokazuje, jak wywołać BaseGet metodę.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
Uwagi
BaseGetMetoda zwraca, null
Jeśli ConfigurationElement w kolekcji nie ma obiektu o określonym kluczu.The BaseGet method returns null
if there is no ConfigurationElement object with the specified key in the collection.