IProducerConsumerCollection<T>.CopyTo(T[], Int32) 方法

定义

将元素 IProducerConsumerCollection<T> 复制到从指定索引开始的元素 Array

public:
 void CopyTo(cli::array <T> ^ array, int index);
public void CopyTo(T[] array, int index);
abstract member CopyTo : 'T[] * int -> unit
Public Sub CopyTo (array As T(), index As Integer)

参数

array
T[]

一维 Array 是从中 IProducerConsumerCollection<T>复制的元素的目标。

数组必须具有从零开始的索引。

index
Int32

从零开始复制的索引 array

例外

array 是空引用(Visual Basic 中没有任何内容)。

index 小于零。

index 等于或大于 array -or- 集合中的元素数大于目标 index 末尾 array的可用空间。

注解

该方法提供基础集合的快照。 其他线程可以在复制后立即添加或删除项。

适用于

另请参阅