PropertyInformationCollection Class (System.Configuration)

Switch View :
ScriptFree
.NET Framework Class Library
PropertyInformationCollection Class

Contains a collection of PropertyInformation objects. This class cannot be inherited.

Inheritance Hierarchy

System.Object
  System.Collections.Specialized.NameObjectCollectionBase
    System.Configuration.PropertyInformationCollection

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

Visual Basic
<SerializableAttribute> _
Public NotInheritable Class PropertyInformationCollection _
	Inherits NameObjectCollectionBase
C#
[SerializableAttribute]
public sealed class PropertyInformationCollection : NameObjectCollectionBase
Visual C++
[SerializableAttribute]
public ref class PropertyInformationCollection sealed : public NameObjectCollectionBase
F#
[<Sealed>]
[<SerializableAttribute>]
type PropertyInformationCollection =  
    class
        inherit NameObjectCollectionBase
    end

The PropertyInformationCollection type exposes the following members.

Properties

  Name Description
Public property Count Gets the number of key/value pairs contained in the NameObjectCollectionBase instance. (Inherited from NameObjectCollectionBase.)
Protected property IsReadOnly Gets or sets a value indicating whether the NameObjectCollectionBase instance is read-only. (Inherited from NameObjectCollectionBase.)
Public property Item Gets the PropertyInformation object in the collection, based on the specified property name.
Public property Keys Gets a NameObjectCollectionBase.KeysCollection instance that contains all the keys in the NameObjectCollectionBase instance. (Inherited from NameObjectCollectionBase.)
Top
Methods

  Name Description
Protected method BaseAdd Adds an entry with the specified key and value into the NameObjectCollectionBase instance. (Inherited from NameObjectCollectionBase.)
Protected method BaseClear Removes all entries from the NameObjectCollectionBase instance. (Inherited from NameObjectCollectionBase.)
Protected method BaseGet(Int32) Gets the value of the entry at the specified index of the NameObjectCollectionBase instance. (Inherited from NameObjectCollectionBase.)
Protected method BaseGet(String) Gets the value of the first entry with the specified key from the NameObjectCollectionBase instance. (Inherited from NameObjectCollectionBase.)
Protected method BaseGetAllKeys Returns a String array that contains all the keys in the NameObjectCollectionBase instance. (Inherited from NameObjectCollectionBase.)
Protected method BaseGetAllValues() Returns an Object array that contains all the values in the NameObjectCollectionBase instance. (Inherited from NameObjectCollectionBase.)
Protected method BaseGetAllValues(Type) Returns an array of the specified type that contains all the values in the NameObjectCollectionBase instance. (Inherited from NameObjectCollectionBase.)
Protected method BaseGetKey Gets the key of the entry at the specified index of the NameObjectCollectionBase instance. (Inherited from NameObjectCollectionBase.)
Protected method BaseHasKeys Gets a value indicating whether the NameObjectCollectionBase instance contains entries whose keys are not null. (Inherited from NameObjectCollectionBase.)
Protected method BaseRemove Removes the entries with the specified key from the NameObjectCollectionBase instance. (Inherited from NameObjectCollectionBase.)
Protected method BaseRemoveAt Removes the entry at the specified index of the NameObjectCollectionBase instance. (Inherited from NameObjectCollectionBase.)
Protected method BaseSet(Int32, Object) Sets the value of the entry at the specified index of the NameObjectCollectionBase instance. (Inherited from NameObjectCollectionBase.)
Protected method BaseSet(String, Object) Sets the value of the first entry with the specified key in the NameObjectCollectionBase instance, if found; otherwise, adds an entry with the specified key and value into the NameObjectCollectionBase instance. (Inherited from NameObjectCollectionBase.)
Public method CopyTo Copies the entire PropertyInformationCollection collection to a compatible one-dimensional Array, starting at the specified index of the target array.
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetEnumerator Gets an IEnumerator object, which is used to iterate through this PropertyInformationCollection collection. (Overrides NameObjectCollectionBase.GetEnumerator().)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetObjectData Populates a SerializationInfo object with the data needed to serialize the PropertyInformationCollection instance. (Overrides NameObjectCollectionBase.GetObjectData(SerializationInfo, StreamingContext).)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method OnDeserialization Implements the ISerializable interface and raises the deserialization event when the deserialization is complete. (Inherited from NameObjectCollectionBase.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Top
Explicit Interface Implementations

  Name Description
Explicit interface implemetation Private method ICollection.CopyTo Copies the entire NameObjectCollectionBase to a compatible one-dimensional Array, starting at the specified index of the target array. (Inherited from NameObjectCollectionBase.)
Explicit interface implemetation Private property ICollection.IsSynchronized Gets a value indicating whether access to the NameObjectCollectionBase object is synchronized (thread safe). (Inherited from NameObjectCollectionBase.)
Explicit interface implemetation Private property ICollection.SyncRoot Gets an object that can be used to synchronize access to the NameObjectCollectionBase object. (Inherited from NameObjectCollectionBase.)
Top
Remarks

The PropertyInformationCollection object contains a collection of PropertyInformation objects. A PropertyInformation object contains the details of an individual attribute within the configuration. The PropertyInformationCollection object is derived from the associated NameObjectCollectionBase object.

Examples

The following code example demonstrates how to use the PropertyInformationCollection class.

Visual Basic

' Create EllementInformation object.
Dim elementInfo As ElementInformation = _
configSection.ElementInformation()
' Create a PropertyInformationCollection object.
Dim propertyInfoCollection As PropertyInformationCollection = _
elementInfo.Properties()
' Create a PropertyInformation object.
Dim myPropertyInfo As PropertyInformation = _
  propertyInfoCollection("enabled")
' Display the property value.
Console.WriteLine _
  ("anonymousIdentification Section - Enabled: {0}", _
  myPropertyInfo.Value)


C#

// Create EllementInformation object.
ElementInformation elementInfo =
  configSection.ElementInformation;
// Create a PropertyInformationCollection object.
PropertyInformationCollection propertyInfoCollection =
  elementInfo.Properties;
// Create a PropertyInformation object.
PropertyInformation myPropertyInfo =
  propertyInfoCollection["enabled"];
// Display the property value.
Console.WriteLine
  ("anonymousIdentification Section - Enabled: {0}",
  myPropertyInfo.Value);


Version Information

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Platforms

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also

Reference