PrincipalCollection PrincipalCollection PrincipalCollection PrincipalCollection Class

定义

派生自 Principal 类的对象的可变集合。A mutable collection of objects derived from the Principal class. 该类设计用于包含 Principal 对象的多值属性。This class is designed to be used for multi-valued properties that contain Principal objects. 对该集合中的内容进行操作将更改相应的存储属性的内容,当在对应的主体对象上调用 Save() 时该存储属性的内容将变成永久性的。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)
继承
PrincipalCollectionPrincipalCollectionPrincipalCollectionPrincipalCollection
实现

属性

Count Count Count Count

返回此集合中 Principal 对象的计数。Returns the count of Principal objects in this collection.

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

返回 falseReturns false. 此集合不是只读集合。This is not a read-only collection.

IsSynchronized IsSynchronized IsSynchronized IsSynchronized

返回 falseReturns false. 应用程序负责序列化对此集合的访问。It is up to the application to serialize access to this collection.

SyncRoot SyncRoot SyncRoot SyncRoot

返回一个同步对象,该对象可用于同步对此集合的访问。Returns a synchronization object that can be used to synchronize access to this collection.

方法

Add(ComputerPrincipal) Add(ComputerPrincipal) Add(ComputerPrincipal) Add(ComputerPrincipal)

将指定的 ComputerPrincipal 对象添加到集合末尾。Adds the specified ComputerPrincipal object to the end of the collection.

Add(GroupPrincipal) Add(GroupPrincipal) Add(GroupPrincipal) Add(GroupPrincipal)

将指定的 GroupPrincipal 对象添加到集合末尾。Adds the specified GroupPrincipal object to the end of the collection.

Add(Principal) Add(Principal) Add(Principal) Add(Principal)

将指定的 Principal 对象添加到集合末尾。Adds the specified Principal object to the end of the collection.

Add(PrincipalContext, IdentityType, String) Add(PrincipalContext, IdentityType, String) Add(PrincipalContext, IdentityType, String) Add(PrincipalContext, IdentityType, String)

搜索与参数匹配的 Principal 对象,并将该对象添加到集合的末尾。Searches for a Principal object that matches the parameters, and adds it to the end of the collection.

Add(UserPrincipal) Add(UserPrincipal) Add(UserPrincipal) Add(UserPrincipal)

将指定的 UserPrincipal 对象添加到集合末尾。Adds the specified UserPrincipal object to the end of the collection.

Clear() Clear() Clear() Clear()

从集合中删除所有 Principal 对象。Removes all Principal objects from the collection.

Contains(ComputerPrincipal) Contains(ComputerPrincipal) Contains(ComputerPrincipal) Contains(ComputerPrincipal)

返回一个值,该值指示集合是否包含指定的 ComputerPrincipal 对象。Returns a value indicating whether the collection contains the specified ComputerPrincipal object.

Contains(GroupPrincipal) Contains(GroupPrincipal) Contains(GroupPrincipal) Contains(GroupPrincipal)

返回一个值,该值指示集合是否包含指定的 GroupPrincipal 对象。Returns a value indicating whether the collection contains the specified GroupPrincipal object.

Contains(Principal) Contains(Principal) Contains(Principal) Contains(Principal)

返回一个值,该值指示集合是否包含指定的 Principal 对象。Returns a value indicating whether the collection contains the specified Principal object.

Contains(PrincipalContext, IdentityType, String) Contains(PrincipalContext, IdentityType, String) Contains(PrincipalContext, IdentityType, String) Contains(PrincipalContext, IdentityType, String)

返回一个值,该值指示匹配 identityType/identityValue 对的 Principal 对象是否位于集合中。Returns a value indicating whether the Principal object matching the identityType/identityValue pair is in the collection.

Contains(UserPrincipal) Contains(UserPrincipal) Contains(UserPrincipal) Contains(UserPrincipal)

返回一个值,该值指示集合是否包含指定的 UserPrincipal 对象。Returns a value indicating whether the collection contains the specified UserPrincipal object.

CopyTo(Principal[], Int32) CopyTo(Principal[], Int32) CopyTo(Principal[], Int32) CopyTo(Principal[], Int32)

从数组中指定的位置索引开始,将 Principal 对象从此 PrincipalCollection 复制到指定的数组中。Copies the Principal objects from this PrincipalCollection into the specified array, starting at the specified position index in array.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

返回一个枚举数,用于循环访问 PrincipalCollection 中的主体。Returns an enumerator to iterate through the principals in the PrincipalCollection.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
Remove(ComputerPrincipal) Remove(ComputerPrincipal) Remove(ComputerPrincipal) Remove(ComputerPrincipal)

从集合中移除指定的 ComputerPrincipal 对象,并在 ComputerPrincipal 是此 PrincipalCollection 的成员时返回 true,否则将返回 false(这种情况下方法不会执行任何操作)。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) Remove(GroupPrincipal) Remove(GroupPrincipal) Remove(GroupPrincipal)

从集合中移除指定的 GroupPrincipal 对象,并在 GroupPrincipal 是此 PrincipalCollection 的成员时返回 true,否则将返回 false(这种情况下方法不会执行任何操作)。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) Remove(Principal) Remove(Principal) Remove(Principal)

从集合中移除指定的 Principal 对象,并在 Principal 是此 PrincipalCollection 的成员时返回 true,否则将返回 false(这种情况下方法不会执行任何操作)。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) Remove(PrincipalContext, IdentityType, String) Remove(PrincipalContext, IdentityType, String) Remove(PrincipalContext, IdentityType, String)

从集合中查找由给定的 PrincipalContextidentityType/identityValue 对指定的 UserPrincipal 对象,并在标识的 Principal 是此 PrincipalCollection 的成员时返回 true,否则将返回 false(这种情况下方法不会执行任何操作)。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) Remove(UserPrincipal) Remove(UserPrincipal) Remove(UserPrincipal)

从集合中移除指定的 UserPrincipal 对象,并在 UserPrincipal 是此 PrincipalCollection 的成员时返回 true,否则将返回 false(这种情况下方法不会执行任何操作)。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() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

显式界面实现

ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)

从数组中指定的位置索引开始,将 Principal 对象从此 PrincipalCollection 复制到指定的数组中。Copies the Principal objects from this PrincipalCollection into the specified array, starting at the specified position index in array.

ICollection.Count ICollection.Count ICollection.Count ICollection.Count

返回此集合中 Principal 对象的计数。Returns the count of Principal objects in this collection.

ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

始终返回 falseAlways returns false. 应用程序负责同步对此集合的访问。It is up to the application to synchronize access to this collection.

ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

返回一个同步对象,该对象可用于同步对此集合的访问。Returns a synchronization object that can be used to synchronize access to this collection. 返回 PrincipalCollection 对象本身。Returns the PrincipalCollection object itself.

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

返回一个枚举数,用于循环访问 PrincipalCollection 中的主体。Returns an enumerator to iterate through the principals in the PrincipalCollection.

扩展方法

CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>)

在给定其泛型参数 TDataTable 的输入 DataRow 对象的情况下,返回包含 IEnumerable<T> 对象副本的 DataRowReturns 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) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption)

在给定其泛型参数 TDataRow 的输入 DataTable 对象的情况下,将 IEnumerable<T> 对象复制到指定的 DataRowCopies 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) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler)

在给定其泛型参数 TDataRow 的输入 DataTable 对象的情况下,将 IEnumerable<T> 对象复制到指定的 DataRowCopies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>) 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) Ancestors<T>(IEnumerable<T>, XName) Ancestors<T>(IEnumerable<T>, XName) Ancestors<T>(IEnumerable<T>, XName)

返回经过筛选的元素集合,其中包含源集合中每个节点的上级。Returns a filtered collection of elements that contains the ancestors of every node in the source collection. 集合中仅包括具有匹配 XName 的元素。Only elements that have a matching XName are included in the collection.

DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>)

返回源集合中每个文档和元素的子代节点的集合。Returns a collection of the descendant nodes of every document and element in the source collection.

Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>) 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) Descendants<T>(IEnumerable<T>, XName) Descendants<T>(IEnumerable<T>, XName) 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. 集合中仅包括具有匹配 XName 的元素。Only elements that have a matching XName are included in the collection.

Elements<T>(IEnumerable<T>) Elements<T>(IEnumerable<T>) Elements<T>(IEnumerable<T>) 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) Elements<T>(IEnumerable<T>, XName) Elements<T>(IEnumerable<T>, XName) Elements<T>(IEnumerable<T>, XName)

返回源集合中经过筛选的每个元素和文档的子元素集合。Returns a filtered collection of the child elements of every element and document in the source collection. 集合中仅包括具有匹配 XName 的元素。Only elements that have a matching XName are included in the collection.

InDocumentOrder<T>(IEnumerable<T>) InDocumentOrder<T>(IEnumerable<T>) InDocumentOrder<T>(IEnumerable<T>) 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>) Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>)

返回源集合中每个文档和元素的子节点集合。Returns a collection of the child nodes of every document and element in the source collection.

Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>)

将源集合中的每个节点从其父节点中移除。Removes every node in the source collection from its parent node.

适用于