.NET Framework Class Library |
ConcurrentBag<(Of <(T>)>)..::.IProducerConsumerCollection<(Of <(T>)>)..::.TryAdd Method |
ConcurrentBag<(Of <(T>)>) Class See Also Send Feedback |
Attempts to add an object to the ConcurrentBag<(Of <(T>)>).
Namespace:
System.Collections.Concurrent
Assembly:
System.Threading (in System.Threading.dll)
Syntax
Visual Basic (Declaration) |
---|
Private Function TryAdd ( _ item As T _ ) As Boolean Implements IProducerConsumerCollection(Of T).TryAdd |
C# |
---|
bool IProducerConsumerCollection<T>.TryAdd( T item ) |
Parameters
- item
- Type: T
The object to be added to the ConcurrentBag<(Of <(T>)>). The value can be a null reference (Nothing in Visual Basic) for reference types.