ConcurrentBag<T> ConcurrentBag<T> ConcurrentBag<T> ConcurrentBag<T> Constructors

定义

重载

ConcurrentBag<T>() ConcurrentBag<T>() ConcurrentBag<T>()

初始化 ConcurrentBag<T> 类的新实例。Initializes a new instance of the ConcurrentBag<T> class.

ConcurrentBag<T>(IEnumerable<T>) ConcurrentBag<T>(IEnumerable<T>) ConcurrentBag<T>(IEnumerable<T>) ConcurrentBag<T>(IEnumerable<T>)

初始化 ConcurrentBag<T> 类的新实例,该类包含从指定集合中复制的元素。Initializes a new instance of the ConcurrentBag<T> class that contains elements copied from the specified collection.

ConcurrentBag<T>() ConcurrentBag<T>() ConcurrentBag<T>()

初始化 ConcurrentBag<T> 类的新实例。Initializes a new instance of the ConcurrentBag<T> class.

public:
 ConcurrentBag();
public ConcurrentBag ();
Public Sub New ()
另请参阅

ConcurrentBag<T>(IEnumerable<T>) ConcurrentBag<T>(IEnumerable<T>) ConcurrentBag<T>(IEnumerable<T>) ConcurrentBag<T>(IEnumerable<T>)

初始化 ConcurrentBag<T> 类的新实例,该类包含从指定集合中复制的元素。Initializes a new instance of the ConcurrentBag<T> class that contains elements copied from the specified collection.

public:
 ConcurrentBag(System::Collections::Generic::IEnumerable<T> ^ collection);
public ConcurrentBag (System.Collections.Generic.IEnumerable<T> collection);
new System.Collections.Concurrent.ConcurrentBag<'T> : seq<'T> -> System.Collections.Concurrent.ConcurrentBag<'T>
Public Sub New (collection As IEnumerable(Of T))

参数

collection
IEnumerable<T> IEnumerable<T> IEnumerable<T> IEnumerable<T>

其元素被复制到新的 ConcurrentBag<T> 中的集合。The collection whose elements are copied to the new ConcurrentBag<T>.

异常

collection 为 null 引用(在 Visual Basic 中为 Nothing)。collection is a null reference (Nothing in Visual Basic).

另请参阅

适用于