ReadOnlyCollectionBuilder<T> 類別
定義
唯讀集合的產生器。The builder for read only collection.
generic <typename T>
public ref class ReadOnlyCollectionBuilder sealed : System::Collections::Generic::ICollection<T>, System::Collections::Generic::IEnumerable<T>, System::Collections::Generic::IList<T>, System::Collections::IList
[System.Serializable]
public sealed class ReadOnlyCollectionBuilder<T> : System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IList<T>, System.Collections.IList
type ReadOnlyCollectionBuilder<'T> = class
interface IList<'T>
interface IList
interface ICollection<'T>
interface seq<'T>
interface IEnumerable
interface ICollection
Public NotInheritable Class ReadOnlyCollectionBuilder(Of T)
Implements ICollection(Of T), IEnumerable(Of T), IList, IList(Of T)
類型參數
- T
集合項目的型別。The type of the collection element.
- 繼承
-
ReadOnlyCollectionBuilder<T>
- 屬性
- 實作
建構函式
ReadOnlyCollectionBuilder<T>() |
建構 ReadOnlyCollectionBuilder<T>。Constructs a ReadOnlyCollectionBuilder<T>. |
ReadOnlyCollectionBuilder<T>(IEnumerable<T>) |
建構 ReadOnlyCollectionBuilder<T>,並複製指定集合的內容。Constructs a ReadOnlyCollectionBuilder<T>, copying the contents of the given collection. |
ReadOnlyCollectionBuilder<T>(Int32) |
使用指定的初始容量,建構 ReadOnlyCollectionBuilder<T>。Constructs a ReadOnlyCollectionBuilder<T> with a given initial capacity. 需要任何重新配置之前,內容是空白,但產生器有保留空間供指定數目的項目使用。The contents are empty but builder will have reserved room for the given number of elements before any reallocations are required. |
屬性
Capacity |
取得或設定此 ReadOnlyCollectionBuilder<T> 的容量。Gets or sets the capacity of this ReadOnlyCollectionBuilder<T>. |
Count |
取得 ReadOnlyCollectionBuilder<T> 中的項目數目。Gets the number of elements in the ReadOnlyCollectionBuilder<T>. |
Item[Int32] |
在指定的索引位置上取得或設定項目。Gets or sets the element at the specified index. |
方法
Add(T) |
將項目加入至 ReadOnlyCollectionBuilder<T>。Adds an item to the ReadOnlyCollectionBuilder<T>. |
Clear() |
從 ReadOnlyCollectionBuilder<T> 中移除所有項目。Removes all items from the ReadOnlyCollectionBuilder<T>. |
Contains(T) |
判斷 ReadOnlyCollectionBuilder<T> 是否包含特定值。Determines whether the ReadOnlyCollectionBuilder<T> contains a specific value. |
CopyTo(T[], Int32) |
從特定的 ReadOnlyCollectionBuilder<T> 索引開始,將 Array 的項目複製到 Array。Copies the elements of the ReadOnlyCollectionBuilder<T> to an Array, starting at particular Array index. |
Equals(Object) |
判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object. (繼承來源 Object) |
GetEnumerator() |
傳回逐一查看集合的列舉值。Returns an enumerator that iterates through the collection. |
GetHashCode() |
作為預設雜湊函數。Serves as the default hash function. (繼承來源 Object) |
GetType() |
取得目前執行個體的 Type。Gets the Type of the current instance. (繼承來源 Object) |
IndexOf(T) |
傳回產生器中第一次出現指定值的索引。Returns the index of the first occurrence of a given value in the builder. |
Insert(Int32, T) |
將項目插入位於指定索引的 ReadOnlyCollectionBuilder<T>。Inserts an item to the ReadOnlyCollectionBuilder<T> at the specified index. |
MemberwiseClone() |
建立目前 Object 的淺層複製。Creates a shallow copy of the current Object. (繼承來源 Object) |
Remove(T) |
從 ReadOnlyCollectionBuilder<T> 移除特定物件之第一個符合的元素。Removes the first occurrence of a specific object from the ReadOnlyCollectionBuilder<T>. |
RemoveAt(Int32) |
移除在指定索引處的 ReadOnlyCollectionBuilder<T> 項目。Removes the ReadOnlyCollectionBuilder<T> item at the specified index. |
Reverse() |
反轉整個 ReadOnlyCollectionBuilder<T> 中項目的順序。Reverses the order of the elements in the entire ReadOnlyCollectionBuilder<T>. |
Reverse(Int32, Int32) |
反向指定範圍中項目的順序。Reverses the order of the elements in the specified range. |
ToArray() |
將 ReadOnlyCollectionBuilder<T> 的項目複製到新的陣列。Copies the elements of the ReadOnlyCollectionBuilder<T> to a new array. |
ToReadOnlyCollection() |
建立 ReadOnlyCollection<T>,其中包含 ReadOnlyCollectionBuilder<T> 的所有項目,可能的話避免將項目複製到新陣列。Creates a ReadOnlyCollection<T> containing all of the elements of the ReadOnlyCollectionBuilder<T>, avoiding copying the elements to the new array if possible. 建立 ReadOnlyCollectionBuilder<T> 之後,重設 ReadOnlyCollection<T>。Resets the ReadOnlyCollectionBuilder<T> after the ReadOnlyCollection<T> has been created. |
ToString() |
傳回代表目前物件的字串。Returns a string that represents the current object. (繼承來源 Object) |
明確介面實作
ICollection.CopyTo(Array, Int32) |
從指定的陣列索引處開始,將 ICollection<T> 的項目複製到陣列。Copies the elements of the ICollection<T> to an array, starting at the specified array index. |
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. |
ICollection<T>.IsReadOnly |
取得值,指出 ICollection<T> 是否唯讀。Gets a value indicating whether the ICollection<T> is read-only. |
IEnumerable.GetEnumerator() |
傳回逐一查看集合的列舉值。Returns an enumerator that iterates through the collection. |
IList.Add(Object) | |
IList.Contains(Object) |
判斷 IList 是否包含特定值。Determines whether the IList contains a specific value. |
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. |
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. |
擴充方法
CopyToDataTable<T>(IEnumerable<T>) |
根據輸入 DataTable 物件 (其中泛型參數 |
CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) |
根據輸入 DataRow 物件 (其中泛型參數 |
CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) |
根據輸入 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 轉換成 IQueryable。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. 集合中只會包含具有相符之 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. |