ConcurrentBag<T>.GetEnumerator ConcurrentBag<T>.GetEnumerator ConcurrentBag<T>.GetEnumerator ConcurrentBag<T>.GetEnumerator Method

定義

傳回在 ConcurrentBag<T> 中逐一查看的列舉值。Returns an enumerator that iterates through the ConcurrentBag<T>.

public:
 virtual System::Collections::Generic::IEnumerator<T> ^ GetEnumerator();
public System.Collections.Generic.IEnumerator<T> GetEnumerator ();
abstract member GetEnumerator : unit -> System.Collections.Generic.IEnumerator<'T>
override this.GetEnumerator : unit -> System.Collections.Generic.IEnumerator<'T>
Public Function GetEnumerator () As IEnumerator(Of T)

傳回

ConcurrentBag<T> 內容的列舉程式。An enumerator for the contents of the ConcurrentBag<T>.

實作

備註

列舉表示包內容的時間點快照集。The enumeration represents a moment-in-time snapshot of the contents of the bag. 在呼叫之後GetEnumerator , 它不會反映集合的任何更新。It does not reflect any updates to the collection after GetEnumerator was called. 列舉值可安全地同時與讀取和寫入包一起使用。The enumerator is safe to use concurrently with reads from and writes to the bag.

適用於

另請參閱