ConfigurationElementCollection.BaseGet Method    
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the ConfigurationElement at the specified index location.
Overloads
| BaseGet(Int32) | Gets the configuration element at the specified index location. | 
| BaseGet(Object) | Returns the configuration element with the specified key. | 
BaseGet(Int32)
Gets the configuration element at the specified index location.
protected public:
 System::Configuration::ConfigurationElement ^ BaseGet(int index);protected:
 System::Configuration::ConfigurationElement ^ BaseGet(int index);protected internal System.Configuration.ConfigurationElement BaseGet(int index);protected System.Configuration.ConfigurationElement BaseGet(int index);member this.BaseGet : int -> System.Configuration.ConfigurationElementProtected Friend Function BaseGet (index As Integer) As ConfigurationElementProtected Function BaseGet (index As Integer) As ConfigurationElementParameters
- index
- Int32
The index location of the ConfigurationElement to return.
Returns
The ConfigurationElement at the specified index.
Exceptions
Examples
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
Applies to
BaseGet(Object)
Returns the configuration element with the specified key.
protected public:
 System::Configuration::ConfigurationElement ^ BaseGet(System::Object ^ key);protected:
 System::Configuration::ConfigurationElement ^ BaseGet(System::Object ^ key);protected internal System.Configuration.ConfigurationElement BaseGet(object key);protected System.Configuration.ConfigurationElement BaseGet(object key);member this.BaseGet : obj -> System.Configuration.ConfigurationElementProtected Friend Function BaseGet (key As Object) As ConfigurationElementProtected Function BaseGet (key As Object) As ConfigurationElementParameters
- key
- Object
The key of the element to return.
Returns
The ConfigurationElement with the specified key; otherwise, null.
Examples
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
The BaseGet method returns null if there is no ConfigurationElement object with the specified key in the collection.