.NET Framework Class Library |
BlockingCollection<(Of <(T>)>)..::.Add Method (T) |
BlockingCollection<(Of <(T>)>) Class See Also Send Feedback |
Adds the item to the BlockingCollection<(Of <(T>)>).
Namespace:
System.Collections.Concurrent
Assembly:
System.Threading (in System.Threading.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Sub Add ( _ item As T _ ) |
C# |
---|
public void Add( T item ) |
Parameters
- item
- Type: T
The item to be added to the collection. The value can be a null reference.
Remarks
If a bounded capacity was specified when this instance of
BlockingCollection<(Of <(T>)>) was initialized,
a call to Add may block until space is available to store the provided item.
Exceptions
Exception | Condition |
---|---|
System..::.InvalidOperationException | The BlockingCollection<(Of <(T>)>) has been marked as complete with regards to additions. |
System..::.ObjectDisposedException | The BlockingCollection<(Of <(T>)>) has been disposed. |
System..::.InvalidOperationException | The underlying collection didn't accept the item. |