Export (0) Print
Expand All

BlockingCollection<T>.Add Method (T)

Adds the item to the BlockingCollection<T>.

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

public void Add(
	T item
)

Parameters

item
Type: T

The item to be added to the collection. The value can be a null reference.

ExceptionCondition
ObjectDisposedException

The BlockingCollection<T> has been disposed.

InvalidOperationException

The BlockingCollection<T> has been marked as complete with regards to additions.

-or-

The underlying collection didn't accept the item.

If a bounded capacity was specified when this instance of BlockingCollection<T> was initialized, a call to Add may block until space is available to store the provided item.

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Portable Class Library

Supported in: Portable Class Library

Supported in: Windows Phone 8.1
Show:
© 2015 Microsoft