ConfigurationElementCollection.BaseGet Método

Definição

Obtém o ConfigurationElement no local de índice especificado.

Sobrecargas

BaseGet(Int32)

Obtém o elemento de configuração no local do índice especificado.

BaseGet(Object)

Retorna o elemento de configuração com a chave especificada.

BaseGet(Int32)

Origem:
ConfigurationElementCollection.cs
Origem:
ConfigurationElementCollection.cs
Origem:
ConfigurationElementCollection.cs

Obtém o elemento de configuração no local do índice especificado.

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

Parâmetros

index
Int32

O local do índice do ConfigurationElement a ser retornado.

Retornos

O ConfigurationElement no índice especificado.

Exceções

index é menor que 0.

- ou -

Não há nenhum ConfigurationElement no index especificado.

Exemplos

O exemplo de código a seguir mostra como chamar o BaseGet método .

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

Aplica-se a

BaseGet(Object)

Origem:
ConfigurationElementCollection.cs
Origem:
ConfigurationElementCollection.cs
Origem:
ConfigurationElementCollection.cs

Retorna o elemento de configuração com a chave especificada.

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

Parâmetros

key
Object

A chave do elemento a retornar.

Retornos

O ConfigurationElement com a chave especificada; caso contrário, null.

Exemplos

O exemplo de código a seguir mostra como chamar o BaseGet método .

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

Comentários

O BaseGet método retornará null se não houver nenhum ConfigurationElement objeto com a chave especificada na coleção.

Aplica-se a