public void CopyTo(T[] array, int arrayIndex) { DoBaseRead(() => { ReadCollection.CopyTo(array, arrayIndex); }); }
public void CopyTo(T[] array, int arrayIndex) { DoBaseRead(() => { if (array.Count() >= ReadCollection.Count) { ReadCollection.CopyTo(array, arrayIndex); } else { Console.Out.WriteLine("ConcurrentObservableCollection attempting to copy into wrong sized array (array.Count < ReadCollection.Count)"); } }); }
public void Collections_CopyTo() { WriteCollection.Add(CreateItem1()); WriteCollection.Add(CreateItem2()); WriteCollection.Add(CreateItem3()); WriteCollection.Add(CreateItem2()); T[] array = new T[ReadCollection.Count]; ReadCollection.CopyTo(array, 0); if (PreservesOrder) { ReadCollection.AssertSequence(array); } else { ReadCollection.AssertContainsOnly(array); } }
public void CopyTo(KeyValuePair <TKey, TValue>[] array, int arrayIndex) { DoBaseRead(() => { ReadCollection.CopyTo(array, arrayIndex); }); }