Export (0) Print
Expand All

ElementInformation Class

Contains meta-information about an individual element within the configuration. This class cannot be inherited.

System.Object
  System.Configuration.ElementInformation

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

[<Sealed>]
type ElementInformation =  class end

The ElementInformation type exposes the following members.

  NameDescription
Public propertyErrorsGets the errors for the associated element and subelements
Public propertyIsCollectionGets a value indicating whether the associated ConfigurationElement object is a ConfigurationElementCollection collection.
Public propertyIsLockedGets a value that indicates whether the associated ConfigurationElement object cannot be modified.
Public propertyIsPresentGets a value indicating whether the associated ConfigurationElement object is in the configuration file.
Public propertyLineNumberGets the line number in the configuration file where the associated ConfigurationElement object is defined.
Public propertyPropertiesGets a PropertyInformationCollection collection of the properties in the associated ConfigurationElement object.
Public propertySourceGets the source file where the associated ConfigurationElement object originated.
Public propertyTypeGets the type of the associated ConfigurationElement object.
Public propertyValidatorGets the object used to validate the associated ConfigurationElement object.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

The ElementInformation object contains meta-information about an individual element within the configuration. This object can be used when validating and changing the properties of an individual element.

The following example shows how to get the ElementInformation associated with a ConfigurationElement object.

No code example is currently available or this language may not be supported.

The following excerpt shows the configuration used by the previous code example.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="MyUrls" type="Samples.AspNet.UrlsSection,
      ConfigurationElement, Version=1.0.0.0, Culture=neutral,
      PublicKeyToken=null" allowDefinition="Everywhere"
      allowExeDefinition="MachineToApplication"
      restartOnExternalChanges="true" />
  </configSections>
  <MyUrls name="MyFavorites">
    <simple name="Contoso" url="http://www.contoso.com" port="8080" />
    <urls>
      <clear />
      <add name="Microsoft" url="http://www.microsoft.com" port="0" />
    </urls>
  </MyUrls>
</configuration>

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft