ElementInformation.Properties Property

 

Gets a PropertyInformationCollection collection of the properties in the associated ConfigurationElement object.

Namespace:   System.Configuration
Assembly:  System.Configuration (in System.Configuration.dll)

Public ReadOnly Property Properties As PropertyInformationCollection

Property Value

Type: System.Configuration.PropertyInformationCollection

A PropertyInformationCollection collection of the properties in the associated ConfigurationElement object.

The properties of a ConfigurationElement object are the attributes and subelements associated with that configuration element in the configuration file.

The following example shows how to get the Properties collection.

Public Shared Sub GetElementProperties() 

    ' Get the current configuration file.
    Dim config _
    As System.Configuration.Configuration = _
    ConfigurationManager.OpenExeConfiguration( _
    ConfigurationUserLevel.None)

    ' Get the section.
    Dim section As UrlsSection = _
    CType(config.GetSection("MyUrls"), UrlsSection)

    ' Get the element.
    Dim url As UrlConfigElement = _
    section.Simple

    ' Get the element properties.
    Dim properties _
    As PropertyInformationCollection = _
    url.ElementInformation.Properties

    Dim prop As PropertyInformation
    For Each prop In  properties
        Console.WriteLine("Name: {0} Type: {1}", _
        prop.Name, prop.Type.ToString())
    Next prop

End Sub 'GetElementProperties

.NET Framework
Available since 2.0
Return to top
Show: