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 的項目複製到 ArrayCopies 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)

將項目加入至 IListAdds 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)

將項目插入位於指定索引的 IListInserts 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>)

根據輸入 DataTable 物件 (其中泛型參數 TDataRow) 傳回包含 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)

根據輸入 DataRow 物件 (其中泛型參數 TDataTable),將 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)

根據輸入 DataRow 物件 (其中泛型參數 TDataTable),將 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.

適用於

另請參閱