BlockingCollection<T> 建構函式

定義

在無上限情況下,初始化 BlockingCollection<T> 類別的新執行個體。Initializes a new instance of the BlockingCollection<T> class without an upper-bound.

多載

BlockingCollection<T>()

在無上限情況下,初始化 BlockingCollection<T> 類別的新執行個體。Initializes a new instance of the BlockingCollection<T> class without an upper-bound.

BlockingCollection<T>(IProducerConsumerCollection<T>)

在無上限情況下,使用提供的 BlockingCollection<T> 做為類別之基礎資料存放區,初始化 IProducerConsumerCollection<T> 類別的新執行個體。Initializes a new instance of the BlockingCollection<T> class without an upper-bound and using the provided IProducerConsumerCollection<T> as its underlying data store.

BlockingCollection<T>(Int32)

在指定的上限情況下,初始化 BlockingCollection<T> 類別的新執行個體。Initializes a new instance of the BlockingCollection<T> class with the specified upper-bound.

BlockingCollection<T>(IProducerConsumerCollection<T>, Int32)

在指定上限情況下,使用提供的 BlockingCollection<T> 做為類別之基礎資料存放區,初始化 IProducerConsumerCollection<T> 類別的新執行個體。Initializes a new instance of the BlockingCollection<T> class with the specified upper-bound and using the provided IProducerConsumerCollection<T> as its underlying data store.

BlockingCollection<T>()

在無上限情況下,初始化 BlockingCollection<T> 類別的新執行個體。Initializes a new instance of the BlockingCollection<T> class without an upper-bound.

public:
 BlockingCollection();
public BlockingCollection ();
Public Sub New ()

備註

預設的基礎集合是一個 ConcurrentQueue<T> 物件,可提供先進先出(FIFO)行為。The default underlying collection is a ConcurrentQueue<T> object, which provides first in, first out (FIFO) behavior.

另請參閱

BlockingCollection<T>(IProducerConsumerCollection<T>)

在無上限情況下,使用提供的 BlockingCollection<T> 做為類別之基礎資料存放區,初始化 IProducerConsumerCollection<T> 類別的新執行個體。Initializes a new instance of the BlockingCollection<T> class without an upper-bound and using the provided IProducerConsumerCollection<T> as its underlying data store.

public:
 BlockingCollection(System::Collections::Concurrent::IProducerConsumerCollection<T> ^ collection);
public BlockingCollection (System.Collections.Concurrent.IProducerConsumerCollection<T> collection);
new System.Collections.Concurrent.BlockingCollection<'T> : System.Collections.Concurrent.IProducerConsumerCollection<'T> -> System.Collections.Concurrent.BlockingCollection<'T>
Public Sub New (collection As IProducerConsumerCollection(Of T))

參數

collection
IProducerConsumerCollection<T>

要做為基礎資料存放區的集合。The collection to use as the underlying data store.

例外狀況

collection 引數為 null。The collection argument is null.

另請參閱

BlockingCollection<T>(Int32)

在指定的上限情況下,初始化 BlockingCollection<T> 類別的新執行個體。Initializes a new instance of the BlockingCollection<T> class with the specified upper-bound.

public:
 BlockingCollection(int boundedCapacity);
public BlockingCollection (int boundedCapacity);
new System.Collections.Concurrent.BlockingCollection<'T> : int -> System.Collections.Concurrent.BlockingCollection<'T>
Public Sub New (boundedCapacity As Integer)

參數

boundedCapacity
Int32

集合的界限大小。The bounded size of the collection.

例外狀況

boundedCapacity 不是一個正數的值。The boundedCapacity is not a positive value.

備註

預設的基礎集合是 ConcurrentQueue<T>The default underlying collection is a ConcurrentQueue<T>.

另請參閱

BlockingCollection<T>(IProducerConsumerCollection<T>, Int32)

在指定上限情況下,使用提供的 BlockingCollection<T> 做為類別之基礎資料存放區,初始化 IProducerConsumerCollection<T> 類別的新執行個體。Initializes a new instance of the BlockingCollection<T> class with the specified upper-bound and using the provided IProducerConsumerCollection<T> as its underlying data store.

public:
 BlockingCollection(System::Collections::Concurrent::IProducerConsumerCollection<T> ^ collection, int boundedCapacity);
public BlockingCollection (System.Collections.Concurrent.IProducerConsumerCollection<T> collection, int boundedCapacity);
new System.Collections.Concurrent.BlockingCollection<'T> : System.Collections.Concurrent.IProducerConsumerCollection<'T> * int -> System.Collections.Concurrent.BlockingCollection<'T>
Public Sub New (collection As IProducerConsumerCollection(Of T), boundedCapacity As Integer)

參數

collection
IProducerConsumerCollection<T>

要做為基礎資料存放區的集合。The collection to use as the underlying data store.

boundedCapacity
Int32

集合的界限大小。The bounded size of the collection.

例外狀況

collection 引數為 null。The collection argument is null.

boundedCapacity 不是一個正數的值。The boundedCapacity is not a positive value.

提供的 collection 其所包含值超過 boundedCapacity 所允許的上限。The supplied collection contains more values than is permitted by boundedCapacity.

另請參閱

適用於