TextElementCollection<TextElementType> 类

定义

提供标准功能,用于创建和管理 TextElement 对象的已排序的类型安全集合。Provides standard facilities for creating and managing a type-safe, ordered collection of TextElement objects. 这是一个泛型集合,可与从 TextElement 派生的指定类型的对象配合使用。This is a generic collection for working with objects of a specified type that derives from TextElement.

generic <typename TextElementType>
 where TextElementType : TextElementpublic ref class TextElementCollection : System::Collections::Generic::ICollection<TextElementType>, System::Collections::Generic::IEnumerable<TextElementType>, System::Collections::IList
public class TextElementCollection<TextElementType> : System.Collections.Generic.ICollection<TextElementType>, System.Collections.Generic.IEnumerable<TextElementType>, System.Collections.IList where TextElementType : TextElement
type TextElementCollection<'extElementType (requires 'extElementType :> TextElement)> = class
    interface IList
    interface ICollection
    interface IEnumerable
    interface ICollection<'extElementType (requires 'extElementType :> TextElement)>
    interface seq<'extElementType (requires 'extElementType :> TextElement)>
Public Class TextElementCollection(Of TextElementType)
Implements ICollection(Of TextElementType), IEnumerable(Of TextElementType), IList

类型参数

TextElementType

泛型集合的类型说明符。Type specifier for the generic collection. 可接受的类型限制为 TextElement 类型或者 TextElement 的派生类。Acceptable types are constrained to a type of TextElement or a descendant of TextElement.

继承
TextElementCollection<TextElementType>
派生
实现

注解

此集合支持从零开始的索引。This collection supports zero-based indexing.

属性

Count

获取当前集合中项的数目。Gets the number of items currently in the collection.

IsReadOnly

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

方法

Add(TextElementType)

将指定的项追加到集合。Appends a specified item to the collection.

AddRange(IEnumerable)

将指定范围内的项追加到集合中。Appends a specified range of items to the collection.

Clear()

清除集合中的所有项。Clears all items from the collection.

Contains(TextElementType)

查询集合中是否存在指定的项。Queries for the presence of a specified item in the collection.

CopyTo(TextElementType[], Int32)

复制集合的内容并插入到指定数组中,从数组中指定的索引位置开始插入。Copies the contents of the collection and inserts them into a specified array starting at a specified index position in the array.

Equals(Object)

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

(继承自 Object)
GetEnumerator()

返回集合内容的一个枚举数。Returns an enumerator for the contents of the collection.

GetHashCode()

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

(继承自 Object)
GetType()

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

(继承自 Object)
InsertAfter(TextElementType, TextElementType)

将集合中的指定项插入到指定集合项之后。Inserts a specified item in the collection after a specified collection item.

InsertBefore(TextElementType, TextElementType)

将集合中的指定项插入到指定集合项之前。Inserts a specified item in the collection before a specified collection item.

MemberwiseClone()

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

(继承自 Object)
Remove(TextElementType)

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

ToString()

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

(继承自 Object)

显式界面实现

ICollection.CopyTo(Array, Int32)

从特定的 ICollection 索引开始,将 Array 的元素复制到一个 Array 中。Copies the elements of the ICollection to an Array, starting at a particular Array index. 改用类型安全的 CopyTo(TextElementType[], Int32) 方法。Use the type-safe CopyTo(TextElementType[], Int32) method instead.

ICollection.Count

获取 ICollection 中包含的元素数。Gets the number of elements contained in the ICollection. 请改用类型安全的 Count 属性。Use the type-safe Count property instead.

ICollection.IsSynchronized

获取一个值,该值指示是否同步对 ICollection 的访问(线程安全)。Gets a value indicating whether access to the ICollection is synchronized (thread safe).

ICollection.SyncRoot

获取可用于同步对 ICollection的访问的对象。Gets an object that can be used to synchronize access to the ICollection.

IEnumerable.GetEnumerator()

返回循环访问集合的枚举数。Returns an enumerator that iterates through a collection. 改用类型安全的 GetEnumerator() 方法。Use the type-safe GetEnumerator() method instead.

IList.Add(Object)

将某项添加到 IList 中。Adds an item to the IList. 改用类型安全的 Add(TextElementType) 方法。Use the type-safe Add(TextElementType) method instead.

IList.Clear()

此类型或成员支持 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 基础结构,但不可直接在代码中使用。This type or member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code. 改用类型安全的 Clear() 方法。Use the type-safe Clear() method instead.

IList.Contains(Object)

确定 IList 是否包含特定值。Determines whether the IList contains a specific value. 改用类型安全的 Contains(TextElementType) 方法。Use the type-safe Contains(TextElementType) method instead.

IList.IndexOf(Object)

确定 IList 中特定项的索引。Determines the index of a specific item in the IList.

IList.Insert(Int32, Object)

IList 中的指定索引处插入一个项。Inserts an item to the IList at the specified index. 请改用类型安全的 InsertAfter(TextElementType, TextElementType)InsertBefore(TextElementType, TextElementType) 方法。Use the type-safe InsertAfter(TextElementType, TextElementType) or InsertBefore(TextElementType, TextElementType) methods instead.

IList.IsFixedSize

获取一个值,该值指示 IList 是否具有固定大小。Gets a value indicating whether the IList has a fixed size.

IList.IsReadOnly

获取一个值,该值指示 IList 是否为只读。Gets a value indicating whether the IList is read-only.

IList.Item[Int32]

获取或设置指定索引处的元素。Gets or sets the element at the specified index.

IList.Remove(Object)

IList 中移除特定对象的第一个匹配项。Removes the first occurrence of a specific object from the IList. 改用类型安全的 Remove(TextElementType) 方法。Use the type-safe Remove(TextElementType) method instead.

IList.RemoveAt(Int32)

移除位于指定索引处的 IList 项。Removes the IList item at the specified index.

扩展方法

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.

适用于

另请参阅