ExtensionCollection<T> 类

定义

表示扩展的集合。Represents a collection of extensions.

generic <typename T>
 where T : IExtensibleObject<T>public ref class ExtensionCollection sealed : System::Collections::Generic::SynchronizedCollection<System::ServiceModel::IExtension<T> ^>, System::Collections::Generic::ICollection<System::ServiceModel::IExtension<T> ^>, System::Collections::Generic::IEnumerable<System::ServiceModel::IExtension<T> ^>, System::ServiceModel::IExtensionCollection<T>
public sealed class ExtensionCollection<T> : System.Collections.Generic.SynchronizedCollection<System.ServiceModel.IExtension<T>>, System.Collections.Generic.ICollection<System.ServiceModel.IExtension<T>>, System.Collections.Generic.IEnumerable<System.ServiceModel.IExtension<T>>, System.ServiceModel.IExtensionCollection<T> where T : IExtensibleObject<T>
type ExtensionCollection<'T (requires 'T :> IExtensibleObject<'T>)> = class
    inherit SynchronizedCollection<IExtension<'T>>
    interface IExtensionCollection<'T (requires 'T :> IExtensibleObject<'T>)>
    interface ICollection<IExtension<'T>>
    interface seq<IExtension<'T>>
    interface IEnumerable
Public NotInheritable Class ExtensionCollection(Of T)
Inherits SynchronizedCollection(Of IExtension(Of T))
Implements ICollection(Of IExtension(Of T)), IEnumerable(Of IExtension(Of T)), IExtensionCollection(Of T)

类型参数

T

集合的类型。The type for the collection.

继承
ExtensionCollection<T>
实现

注解

通常,System.ServiceModel.IExtensibleObject<T> 实现会从 ExtensionCollection<T> 属性返回 IExtensibleObject<T>.ExtensionsTypically, implementations of System.ServiceModel.IExtensibleObject<T> return an ExtensionCollection<T> from the IExtensibleObject<T>.Extensions property.

构造函数

ExtensionCollection<T>(T)

使用指定的所有者初始化 ExtensionCollection<T> 类的新实例。Initializes a new instance of the ExtensionCollection<T> class with a specified owner.

ExtensionCollection<T>(T, Object)

使用指定的所有者和同步根初始化 ExtensionCollection<T> 类的新实例。Initializes a new instance of the ExtensionCollection<T> class with a specified owner and synchronization root.

属性

Count

获取线程安全集合中所含元素的数目。Gets the number of elements contained in the thread-safe collection.

(继承自 SynchronizedCollection<T>)
Item[Int32]

获取线程安全集合中具有指定索引的元素。Gets an element from the thread-safe collection with a specified index.

(继承自 SynchronizedCollection<T>)
Items

获取线程安全集合中所含元素的列表。Gets the list of elements contained in the thread-safe collection.

(继承自 SynchronizedCollection<T>)
SyncRoot

获取用于对线程安全集合的访问进行同步的对象。Gets the object used to synchronize access to the thread-safe collection.

(继承自 SynchronizedCollection<T>)

方法

Add(T)

将项添加到线程安全只读集合中。Adds an item to the thread-safe, read-only collection.

(继承自 SynchronizedCollection<T>)
Clear()

从集合中移除所有项。Removes all items from the collection.

(继承自 SynchronizedCollection<T>)
ClearItems()

从集合中移除所有项。Removes all items from the collection.

(继承自 SynchronizedCollection<T>)
Contains(T)

确定集合是否包含具有特定值的元素。Determines whether the collection contains an element with a specific value.

(继承自 SynchronizedCollection<T>)
CopyTo(T[], Int32)

从特定索引处开始,将集合中的元素复制到指定的数组。Copies the elements of the collection to a specified array, starting at a particular index.

(继承自 SynchronizedCollection<T>)
Equals(Object)

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

(继承自 Object)
Find<E>()

返回在集合中找到的一个扩展。Returns an extension if it is in the collection.

FindAll<E>()

返回在集合中找到的扩展的集合。Returns a collection of extensions if found in the collection.

GetEnumerator()

返回一个循环访问同步集合的枚举数。Returns an enumerator that iterates through the synchronized collection.

(继承自 SynchronizedCollection<T>)
GetHashCode()

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

(继承自 Object)
GetType()

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

(继承自 Object)
IndexOf(T)

返回某个值在集合中的第一个匹配项的索引。Returns the index of the first occurrence of a value in the collection.

(继承自 SynchronizedCollection<T>)
Insert(Int32, T)

将某个项插入到集合中的指定索引处。Inserts an item into the collection at a specified index.

(继承自 SynchronizedCollection<T>)
InsertItem(Int32, T)

将某个项插入到集合中的指定索引处。Inserts an item into the collection at a specified index.

(继承自 SynchronizedCollection<T>)
MemberwiseClone()

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

(继承自 Object)
Remove(T)

从集合中移除指定项的第一个匹配项。Removes the first occurrence of a specified item from the collection.

(继承自 SynchronizedCollection<T>)
RemoveAt(Int32)

从集合中移除指定索引处的项。Removes an item at a specified index from the collection.

(继承自 SynchronizedCollection<T>)
RemoveItem(Int32)

从集合中移除指定 index 处的项。Removes an item at a specified index from the collection.

(继承自 SynchronizedCollection<T>)
SetItem(Int32, T)

使用另一项替换指定索引处的项。Replaces the item at a specified index with another item.

(继承自 SynchronizedCollection<T>)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

显式界面实现

ICollection.CopyTo(Array, Int32)

从特定索引处开始,将集合中的元素复制到指定的数组。Copies the elements of the collection to a specified array, starting at a particular index.

(继承自 SynchronizedCollection<T>)
ICollection.IsSynchronized

获取一个值,指示集合是否为线程安全集合。Gets a value that indicates whether the collection is thread safe.

(继承自 SynchronizedCollection<T>)
ICollection.SyncRoot

获取用于对线程安全集合的访问进行同步的对象。Gets the object used to synchronize access to the thread-safe collection.

(继承自 SynchronizedCollection<T>)
ICollection<IExtension<T>>.IsReadOnly

获取一个值,该值指示集合是否为只读。Gets whether the collection is read-only.

ICollection<T>.IsReadOnly

获取一个值,指示集合是否为只读集合。Gets a value that indicates whether the collection is read only.

(继承自 SynchronizedCollection<T>)
IEnumerable.GetEnumerator()

返回一个循环访问同步集合的枚举数。Returns an enumerator that iterates through the synchronized collection.

(继承自 SynchronizedCollection<T>)
IList.Add(Object)

将一个元素添加到集合中。Adds an element to the collection.

(继承自 SynchronizedCollection<T>)
IList.Contains(Object)

确定集合是否包含具有特定值的元素。Determines whether the collection contains an element with a specific value.

(继承自 SynchronizedCollection<T>)
IList.IndexOf(Object)

确定集合中某个元素的从零开始的索引。Determines the zero-based index of an element in the collection.

(继承自 SynchronizedCollection<T>)
IList.Insert(Int32, Object)

将某个对象插入到集合中的指定索引处。Inserts an object into the collection at a specified index.

(继承自 SynchronizedCollection<T>)
IList.IsFixedSize

获取一个值,指示集合是否具有固定大小。Gets a value that indicates whether the collection is fixed in size.

(继承自 SynchronizedCollection<T>)
IList.IsReadOnly

获取一个值,指示集合是否为只读集合。Gets a value that indicates whether the collection is read only.

(继承自 SynchronizedCollection<T>)
IList.Item[Int32]

获取或设置位于从零开始的指定索引处的项。Gets or sets the item at a specified zero-based index.

(继承自 SynchronizedCollection<T>)
IList.Remove(Object)

从集合中移除作为元素的指定对象的第一个匹配项。Removes the first occurrence of a specified object as an element from the collection.

(继承自 SynchronizedCollection<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)

在给定其泛型参数 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)

在给定其泛型参数 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)

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

OfType<TResult>(IEnumerable)

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

AsParallel(IEnumerable)

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

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts 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. 集合中仅包括具有匹配 XName 的元素。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. 集合中仅包括具有匹配 XName 的元素。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. 集合中仅包括具有匹配 XName 的元素。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.

适用于