ConfigurationElementCollection.BaseGet Método

Definição

Obtém-nos ConfigurationElement na localização de índice especificada.

Sobrecargas

Name Description
BaseGet(Int32)

Obtém o elemento de configuração na localização do índice especificada.

BaseGet(Object)

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

BaseGet(Int32)

Obtém o elemento de configuração na localização do índice especificada.

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

Parâmetros

index
Int32

A localização do índice do ConfigurationElement para devolver.

Devoluções

O ConfigurationElement no índice especificado.

Exceções

index é inferior a 0.

-ou-

Não existe ConfigurationElement no especificado index.

Exemplos

O exemplo de código seguinte 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)

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

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

Parâmetros

key
Object

A chave do elemento para regressar.

Devoluções

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

Exemplos

O exemplo de código seguinte 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

Observações

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

Aplica-se a