ConcurrentStack<T>.IProducerConsumerCollection<T>.TryTake Metode

Definisi

Mencoba untuk menghapus dan mengembalikan objek dari IProducerConsumerCollection<T>.

 virtual bool System.Collections.Concurrent.IProducerConsumerCollection<T>.TryTake([Runtime::InteropServices::Out] T % item) = System::Collections::Concurrent::IProducerConsumerCollection<T>::TryTake;
bool IProducerConsumerCollection<T>.TryTake (out T item);
abstract member System.Collections.Concurrent.IProducerConsumerCollection<T>.TryTake : 'T -> bool
override this.System.Collections.Concurrent.IProducerConsumerCollection<T>.TryTake : 'T -> bool
Function TryTake (ByRef item As T) As Boolean Implements IProducerConsumerCollection(Of T).TryTake

Parameter

item
T

Ketika metode ini kembali, jika operasi berhasil, item berisi objek yang dihapus. Jika tidak ada objek yang tersedia untuk dihapus, nilainya tidak ditentukan.

Mengembalikan

true jika elemen dihapus dan berhasil dikembalikan; jika tidak, false.

Penerapan

Keterangan

Untuk ConcurrentStack<T>, operasi ini akan mencoba memunculkan objek di bagian ConcurrentStack<T>atas .

Berlaku untuk

Lihat juga