GetElementKey Method
.NET Framework Class Library
ConfigurationElementCollection..::.GetElementKey Method

Gets the element key for a specified configuration element when overridden in a derived class.

Namespace:  System.Configuration
Assembly:  System.Configuration (in System.Configuration.dll)
Visual Basic (Declaration)
Protected MustOverride Function GetElementKey ( _
    element As ConfigurationElement _
) As Object
Visual Basic (Usage)
Dim element As ConfigurationElement
Dim returnValue As Object

returnValue = Me.GetElementKey(element)
C#
protected abstract Object GetElementKey(
    ConfigurationElement element
)
Visual C++
protected:
virtual Object^ GetElementKey(
    ConfigurationElement^ element
) abstract
JScript
protected abstract function GetElementKey(
    element : ConfigurationElement
) : Object

Parameters

element
Type: System.Configuration..::.ConfigurationElement
The ConfigurationElement to return the key for.

Return Value

Type: System..::.Object
An Object that acts as the key for the specified ConfigurationElement.

The following code example shows how to override GetElementKey method.

Visual Basic
Protected Overrides Function GetElementKey( _
    ByVal element As ConfigurationElement) As [Object]

    Return CType(element, UrlConfigElement).Name
End Function 'GetElementKey
C#
protected override Object 
    GetElementKey(ConfigurationElement element)
{
    return ((UrlConfigElement)element).Name;
}

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
Page view tracker