PrincipalCollection Class

Definition

A mutable collection of objects derived from the Principal class. This class is designed to be used for multi-valued properties that contain Principal objects. Manipulating the contents of this collection changes the contents of the corresponding store property, which is made permanent when Save() is called on the corresponding principal object.

public ref class PrincipalCollection : System::Collections::Generic::ICollection<System::DirectoryServices::AccountManagement::Principal ^>, System::Collections::Generic::IEnumerable<System::DirectoryServices::AccountManagement::Principal ^>, System::Collections::ICollection
public class PrincipalCollection : System.Collections.Generic.ICollection<System.DirectoryServices.AccountManagement.Principal>, System.Collections.Generic.IEnumerable<System.DirectoryServices.AccountManagement.Principal>, System.Collections.ICollection
type PrincipalCollection = class
    interface ICollection<Principal>
    interface seq<Principal>
    interface IEnumerable
    interface ICollection
Public Class PrincipalCollection
Implements ICollection, ICollection(Of Principal), IEnumerable(Of Principal)
Inheritance
PrincipalCollection
Implements

Properties

Count

Returns the count of Principal objects in this collection.

IsReadOnly

Returns false. This is not a read-only collection.

IsSynchronized

Returns false. It is up to the application to serialize access to this collection.

SyncRoot

Returns a synchronization object that can be used to synchronize access to this collection.

Methods

Add(ComputerPrincipal)

Adds the specified ComputerPrincipal object to the end of the collection.

Add(GroupPrincipal)

Adds the specified GroupPrincipal object to the end of the collection.

Add(Principal)

Adds the specified Principal object to the end of the collection.

Add(PrincipalContext, IdentityType, String)

Searches for a Principal object that matches the parameters, and adds it to the end of the collection.

Add(UserPrincipal)

Adds the specified UserPrincipal object to the end of the collection.

Clear()

Removes all Principal objects from the collection.

Contains(ComputerPrincipal)

Returns a value indicating whether the collection contains the specified ComputerPrincipal object.

Contains(GroupPrincipal)

Returns a value indicating whether the collection contains the specified GroupPrincipal object.

Contains(Principal)

Returns a value indicating whether the collection contains the specified Principal object.

Contains(PrincipalContext, IdentityType, String)

Returns a value indicating whether the Principal object matching the identityType/identityValue pair is in the collection.

Contains(UserPrincipal)

Returns a value indicating whether the collection contains the specified UserPrincipal object.

CopyTo(Principal[], Int32)

Copies the Principal objects from this PrincipalCollection into the specified array, starting at the specified position index in array.

Equals(Object)

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

(Inherited from Object)
GetEnumerator()

Returns an enumerator to iterate through the principals in the PrincipalCollection.

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Remove(ComputerPrincipal)

Removes the specified ComputerPrincipal object from the collection, and returns true if the ComputerPrincipal was a member of this PrincipalCollection, and false otherwise (in which case the method performs no operation).

Remove(GroupPrincipal)

Removes the specified GroupPrincipal object from the collection, and returns true if the GroupPrincipal was a member of this PrincipalCollection, and false otherwise (in which case the method performs no operation).

Remove(Principal)

Removes the specified Principal object from the collection, and returns true if the Principal was a member of this PrincipalCollection, and false otherwise (in which case the method performs no operation).

Remove(PrincipalContext, IdentityType, String)

Finds the UserPrincipal object specified by the given PrincipalContext and identityType/identityValue pair from the collection, and returns true if the identified Principal was a member of this PrincipalCollection, and false otherwise (in which case the method performs no operation).

Remove(UserPrincipal)

Removes the specified UserPrincipal object from the collection, and returns true if the UserPrincipal was a member of this PrincipalCollection, and false otherwise (in which case the method performs no operation).

ToString()

Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

ICollection.CopyTo(Array, Int32)

Copies the Principal objects from this PrincipalCollection into the specified array, starting at the specified position index in array.

ICollection.Count

Returns the count of Principal objects in this collection.

ICollection.IsSynchronized

Always returns false. It is up to the application to synchronize access to this collection.

ICollection.SyncRoot

Returns a synchronization object that can be used to synchronize access to this collection. Returns the PrincipalCollection object itself.

IEnumerable.GetEnumerator()

Returns an enumerator to iterate through the principals in the PrincipalCollection.

Extension Methods

CopyToDataTable<T>(IEnumerable<T>)

Returns a DataTable that contains copies of the DataRow objects, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption)

Copies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler)

Copies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

Cast<TResult>(IEnumerable)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

Enables parallelization of a query.

AsQueryable(IEnumerable)

Converts an IEnumerable to an IQueryable.

Ancestors<T>(IEnumerable<T>)

Returns a collection of elements that contains the ancestors of every node in the source collection.

Ancestors<T>(IEnumerable<T>, XName)

Returns a filtered collection of elements that contains the ancestors of every node in the source collection. Only elements that have a matching XName are included in the collection.

DescendantNodes<T>(IEnumerable<T>)

Returns a collection of the descendant nodes of every document and element in the source collection.

Descendants<T>(IEnumerable<T>)

Returns a collection of elements that contains the descendant elements of every element and document in the source collection.

Descendants<T>(IEnumerable<T>, XName)

Returns a filtered collection of elements that contains the descendant elements of every element and document in the source collection. Only elements that have a matching XName are included in the collection.

Elements<T>(IEnumerable<T>)

Returns a collection of the child elements of every element and document in the source collection.

Elements<T>(IEnumerable<T>, XName)

Returns a filtered collection of the child elements of every element and document in the source collection. Only elements that have a matching XName are included in the collection.

InDocumentOrder<T>(IEnumerable<T>)

Returns a collection of nodes that contains all nodes in the source collection, sorted in document order.

Nodes<T>(IEnumerable<T>)

Returns a collection of the child nodes of every document and element in the source collection.

Remove<T>(IEnumerable<T>)

Removes every node in the source collection from its parent node.

Applies to