Share via


PropertyValueCollection

The PropertyValueCollection class contains the values of a DirectoryEntry property.

The PropertyValueCollection class is derived from the System.Collections.CollectionBase class.

Public Methods

The PropertyValueCollection class has the following public methods.

Method Description
Add(Object)

Appends a property value to this collection.

AddRange(Object[])

Overloaded. Appends a set of property values to this collection.

AddRange(PropertyValueCollection)

Overloaded. Appends a set of property values to this collection.

Clear()

Removes all objects from the CollectionBase instance.

Contains(Object)

Determines whether a specified property value is in this collection.

CopyTo(Object[], Int32)

Copies the properties from this collection to an array, starting at a particular index of the array.

Equals(Object)

Determines whether the specified Object is equal to the current Object.

GetEnumerator()

Returns an enumerator that can iterate through the CollectionBase instance.

GetHashCode()

Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.

GetType()

Gets the Type of the current instance.

IndexOf(Object)

Retrieves the index of a specified property value in this collection.

Insert(Int32, Object)

Inserts a property value into this collection at a specified index.

Remove(Object)

Removes a specified property value from this collection.

RemoveAt(Int32)

Removes the element at the specified index of the CollectionBase instance.

ToString()

Returns a String that represents the current Object.

Public Properties

The PropertyValueCollection class has the following public properties.

Property Description
Count Data type: Int32
Access type: Read-only

Gets the number of elements contained in the CollectionBase instance.

Item Data type: Object
Access type: Read/write

Gets or sets the property value that is located at a specified index of this collection.

In C#, this property is the indexer for the PropertyValueCollection class.

Value Data type: Object
Access type: Read/write

Gets or sets the values of the collection.

Protected Methods

The PropertyValueCollection class has the following protected methods.

Method Description
Finalize()

Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.

MemberwiseClone()

Creates a shallow copy of the current Object.

OnClear()

Performs additional custom processes when clearing the contents of the CollectionBase instance.

OnClearComplete()

Overridden. See CollectionBase.OnClearComplete.

OnInsert(Int32, Object)

Performs additional custom processes before inserting a new element into the CollectionBase instance.

OnInsertComplete(Int32, Object)

Overridden. See CollectionBase.OnInsertComplete.

OnRemove(Int32, Object)

Performs additional custom processes when removing an element from the CollectionBase instance.

OnRemoveComplete(Int32, Object)

Overridden. See CollectionBase.OnRemoveComplete.

OnSet(Int32, Object, Object)

Performs additional custom processes before setting a value in the CollectionBase instance.

OnSetComplete(Int32, Object, Object)

Overridden. See CollectionBase.OnSetComplete.

OnValidate(Object)

Performs additional custom processes when validating a value.

Protected Properties

The PropertyValueCollection class has the following protected properties.

Property Description
InnerList Data type: ArrayList
Access type: Read-only

Gets an ArrayList containing the list of elements in the CollectionBase instance.

List Data type: IList
Access type: Read-only

Gets an IList containing the list of elements in the CollectionBase instance.

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.

Requirements

Client Requires Windows XP Home Edition, Windows XP Professional, Windows Me, or Windows 98.
Server Requires Windows Server 2003, Windows 2000, or Windows NT 4.0.
Namespace

Defined in System.DirectoryServices.

Assembly

Requires System.DirectoryServices (in System.DirectoryServices.dll).

.NET Framework

Requires .NET Framework 1.0.

See Also

System.DirectoryServices Namespace, Managed Extensions for C++ Programming