ConcurrentBag<T>.IProducerConsumerCollection<T>.TryAdd(T) 方法

定義

嘗試將物件加入至 ConcurrentBag<T>

 virtual bool System.Collections.Concurrent.IProducerConsumerCollection<T>.TryAdd(T item) = System::Collections::Concurrent::IProducerConsumerCollection<T>::TryAdd;
bool IProducerConsumerCollection<T>.TryAdd (T item);
abstract member System.Collections.Concurrent.IProducerConsumerCollection<T>.TryAdd : 'T -> bool
override this.System.Collections.Concurrent.IProducerConsumerCollection<T>.TryAdd : 'T -> bool
Function TryAdd (item As T) As Boolean Implements IProducerConsumerCollection(Of T).TryAdd

參數

item
T

要加入 ConcurrentBag<T> 的物件。 值可以是參考類型的 null 參考 (在 Visual Basic 中為 Nothing)。

傳回

永遠傳回 true。

實作

適用於

另請參閱