ConcurrentQueue<T>.IProducerConsumerCollection<T>.TryAdd(T) ConcurrentQueue<T>.IProducerConsumerCollection<T>.TryAdd(T) ConcurrentQueue<T>.IProducerConsumerCollection<T>.TryAdd(T) Method

Definição

Tenta adicionar um objeto ao IProducerConsumerCollection<T>.Attempts to add an object to the IProducerConsumerCollection<T>.

 virtual bool System.Collections.Concurrent.IProducerConsumerCollection<T>.TryAdd(T item) = System::Collections::Concurrent::IProducerConsumerCollection<T>::TryAdd;
bool IProducerConsumerCollection<T>.TryAdd (T item);
Function TryAdd (item As T) As Boolean Implements IProducerConsumerCollection(Of T).TryAdd

Parâmetros

item
T T T

O objeto a ser adicionado ao IProducerConsumerCollection<T>.The object to add to the IProducerConsumerCollection<T>. O valor pode ser uma referência nula (Nada no Visual Basic) para tipos de referência.The value can be a null reference (Nothing in Visual Basic) for reference types.

Retornos

true se um objeto tiver sido removido com êxito; caso contrário, false.true if the object was added successfully; otherwise, false.

Implementações

Comentários

Para ConcurrentQueue<T>, essa operação sempre adicionará o objeto ao final ConcurrentQueue<T> do e retornará true.For ConcurrentQueue<T>, this operation will always add the object to the end of the ConcurrentQueue<T> and return true.

Aplica-se a

Veja também