Export (0) Print
Expand All

BlockingCollection<T>.IEnumerable<T>.GetEnumerator Method

Provides an IEnumerator<T> for items in the collection.

Namespace:  System.Collections.Concurrent
Assembly:  System (in System.dll)

IEnumerator<T> IEnumerable<T>.GetEnumerator()

Return Value

Type: System.Collections.Generic.IEnumerator<T>
An IEnumerator<T> for the items in the collection.

Implements

IEnumerable<T>.GetEnumerator()

ExceptionCondition
ObjectDisposedException

The BlockingCollection<T> has been disposed.

Unlike GetConsumingEnumerable, BlockingCollection<T>.IEnumerable<T>.GetEnumerator returns a standard enumerator that does not modify the underlying collection. 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.

.NET Framework

Supported in: 4

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft