ImmutableList<T>.Enumerator ImmutableList<T>.Enumerator ImmutableList<T>.Enumerator ImmutableList<T>.Enumerator Struct

定義

列舉二進位樹狀目錄的內容。Enumerates the contents of a binary tree.

NuGet 套件System.Collections.Immutable (關於固定集合及其安裝方法)NuGet package: System.Collections.Immutable (about immutable collections and how to install)

public: value class ImmutableList<T>::Enumerator : System::Collections::Generic::IEnumerator<T>
public struct ImmutableList<T>.Enumerator : System.Collections.Generic.IEnumerator<T>
type ImmutableList<'T>.Enumerator = struct
    interface IEnumerator<'T>
    interface IEnumerator
    interface IDisposable
Public Structure ImmutableList(Of T).Enumerator
Implements IEnumerator(Of T)

類型參數

T
繼承
ImmutableList<T>.EnumeratorImmutableList<T>.EnumeratorImmutableList<T>.EnumeratorImmutableList<T>.Enumerator
實作

備註

此結構應該保持同步與其他兩個的二進位樹狀目錄中列舉值:System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue>.EnumeratorSystem.Collections.Immutable.ImmutableSortedSet<T>.EnumeratorThis structure should be kept synchronized with the other two binary tree enumerators: System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue>.Enumerator and System.Collections.Immutable.ImmutableSortedSet<T>.Enumerator.

警告

當這個列舉值做為值類型 (也就是當它未經過 boxing 處理),執行不會複製它,將它指派給第二個變數,或將它傳遞給另一種方法。When this enumerator is used as a value type (that is, when it isn't boxed), do not copy it by assigning it to a second variable or by passing it to another method. 當處置此列舉值時,它傳回可變動參考類型的堆疊資源集區,而如果值的類型列舉值複製 (會發生這個情況容易不小心如果您傳遞周圍的值),則會有風險,已經過的堆疊傳回資源集區仍然可能在使用其中一個列舉值的複本,導致資料損毀或例外狀況。When this enumerator is disposed of, it returns a mutable reference type stack to a resource pool, and if the value type enumerator is copied (which can easily happen unintentionally if you pass the value around), there is a risk that a stack that has already been returned to the resource pool may still be in use by one of the enumerator copies, leading to data corruption or exceptions.

屬性

Current Current Current Current

取得位於目前列舉值位置的項目。Gets the element at the current position of the enumerator.

方法

Dispose() Dispose() Dispose() Dispose()

ImmutableList<T>.Enumerator 類別的目前執行個體所使用的資源釋出。Releases the resources used by the current instance of the ImmutableList<T>.Enumerator class.

MoveNext() MoveNext() MoveNext() MoveNext()

將列舉往前推至不可變清單的下一個項目。Advances enumeration to the next element of the immutable list.

Reset() Reset() Reset() Reset()

將列舉程式設定為它的初始位置,這是在不可變清單中的第一個項目之前。Sets the enumerator to its initial position, which is before the first element in the immutable list.

明確介面實作

IEnumerator.Current IEnumerator.Current IEnumerator.Current IEnumerator.Current

目前的元素。The current element.

適用於

執行緒安全性

此型別具備執行緒安全。This type is thread safe.