BlockingCollection<T>.IEnumerable<T>.GetEnumerator 方法

定義

提供集合中項目的 IEnumerator<T>Provides an IEnumerator<T> for items in the collection.

 virtual System::Collections::Generic::IEnumerator<T> ^ System.Collections.Generic.IEnumerable<T>.GetEnumerator() = System::Collections::Generic::IEnumerable<T>::GetEnumerator;
System.Collections.Generic.IEnumerator<T> IEnumerable<T>.GetEnumerator ();
Function GetEnumerator () As IEnumerator(Of T) Implements IEnumerable(Of T).GetEnumerator

傳回

集合中項目的 IEnumerator<T>An IEnumerator<T> for the items in the collection.

實作

例外狀況

備註

不同于 GetConsumingEnumerableBlockingCollection<T>.IEnumerable<T>.GetEnumerator 會傳回不會修改基礎集合的標準列舉值。Unlike GetConsumingEnumerable, BlockingCollection<T>.IEnumerable<T>.GetEnumerator returns a standard enumerator that does not modify the underlying collection. 如果在呼叫 GetEnumerator 時,其他執行緒同時新增或移除元素,則列舉值所傳回的元素可能不代表集合的目前狀態。If other threads are adding or removing elements concurrently when GetEnumerator is called, then the elements returned by the enumerator might not represent the current state of the collection.

適用於

另請參閱