BlockingCollection<T>.ToArray 方法

定義

BlockingCollection<T> 執行個體,將其中項目複製到新陣列。Copies the items from the BlockingCollection<T> instance into a new array.

public:
 cli::array <T> ^ ToArray();
public T[] ToArray ();
member this.ToArray : unit -> 'T[]
Public Function ToArray () As T()

傳回

T[]

陣列,包含集合項目之複本的陣列。An array containing copies of the elements of the collection.

例外狀況

備註

複製的元素不會從集合中移除。The copied elements are not removed from the collection.

如果 BlockingCollection 中的任何方法在 ToArray 方法執行時執行,則傳回值為近似值。If any method in BlockingCollection is executing while the ToArray method executes, the return value is approximate. ToArray 可能包含已移除的專案,或排除已經插入的專案。ToArray may include items that have already been removed, or exclude items that have already been inserted.

適用於

另請參閱