BlockingCollection<T> 建構函式

定義

初始化該類別的新實例 BlockingCollection<T> ,且不包含上界。

多載

名稱 Description
BlockingCollection<T>()

初始化該類別的新實例 BlockingCollection<T> ,且不包含上界。

BlockingCollection<T>(IProducerConsumerCollection<T>)

初始化一個沒有上限的新類別實例 BlockingCollection<T> ,並以提供的 IProducerConsumerCollection<T> 作為底層資料儲存。

BlockingCollection<T>(Int32)

初始化一個具有指定上界的類別新實例 BlockingCollection<T>

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

初始化該類別的新實例 BlockingCollection<T> ,使用指定的上限,並以提供的 IProducerConsumerCollection<T> 作為底層資料儲存。

BlockingCollection<T>()

來源:
BlockingCollection.cs
來源:
BlockingCollection.cs
來源:
BlockingCollection.cs
來源:
BlockingCollection.cs
來源:
BlockingCollection.cs

初始化該類別的新實例 BlockingCollection<T> ,且不包含上界。

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

備註

預設的底層集合是一個 ConcurrentQueue<T> 物件,提供先進先出(FIFO)行為。

另請參閱

適用於

BlockingCollection<T>(IProducerConsumerCollection<T>)

來源:
BlockingCollection.cs
來源:
BlockingCollection.cs
來源:
BlockingCollection.cs
來源:
BlockingCollection.cs
來源:
BlockingCollection.cs

初始化一個沒有上限的新類別實例 BlockingCollection<T> ,並以提供的 IProducerConsumerCollection<T> 作為底層資料儲存。

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>

這個集合作為底層資料儲存。

例外狀況

這個 collection 論證是空的。

另請參閱

適用於

BlockingCollection<T>(Int32)

來源:
BlockingCollection.cs
來源:
BlockingCollection.cs
來源:
BlockingCollection.cs
來源:
BlockingCollection.cs
來源:
BlockingCollection.cs

初始化一個具有指定上界的類別新實例 BlockingCollection<T>

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

收藏的有界規模。

例外狀況

boundedCapacity 並不是正值。

備註

預設的底層集合為 ConcurrentQueue<T>

另請參閱

適用於

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

來源:
BlockingCollection.cs
來源:
BlockingCollection.cs
來源:
BlockingCollection.cs
來源:
BlockingCollection.cs
來源:
BlockingCollection.cs

初始化該類別的新實例 BlockingCollection<T> ,使用指定的上限,並以提供的 IProducerConsumerCollection<T> 作為底層資料儲存。

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>

這個集合作為底層資料儲存。

boundedCapacity
Int32

收藏的有界規模。

例外狀況

這個 collection 論證是空的。

boundedCapacity 並不是正值。

所提供的 collection 值比允許 boundedCapacity的值還多。

另請參閱

適用於