#pragma warning disable SA1600
        void ILargeCollection.CopyTo(Array array, int index)
#pragma warning restore SA1600
        {
#if STRICT
            if (array == null)
            {
                throw new ArgumentNullException("dest");
            }
#else
            if (array == null)
            {
                throw new ArgumentNullException(nameof(array));
            }
#endif

#if STRICT
            if (index < 0)
            {
                throw new ArgumentOutOfRangeException("dstIndex", "Number was less than the array's lower bound in the first dimension.");
            }
#else
            if (index < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(index), "Number was less than the array's lower bound in the first dimension.");
            }
#endif

            if (index + Count > array.Length)
            {
                throw new ArgumentException("Destination array was not long enough. Check " + nameof(index) + " and length, and the array's lower bounds.");
            }

            ILargeCollection AsCollection = (ILargeCollection)Items;
            AsCollection.CopyTo(array, index);
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LargeCollectionDebugView{T}"/> class.
 /// Creates a proxy for the specified collection.
 /// </summary>
 /// <param name="collection">The collection that is wrapped by the new collection.</param>
 /// <exception cref="ArgumentNullException"><paramref name="collection"/> is null.</exception>
 public LargeCollectionDebugView(ILargeCollection <T> collection)
 {
     if (collection == null)
     {
         throw new ArgumentNullException(nameof(collection));
     }
     this.collection = collection;
 }
Пример #3
0
        void ILargeCollection.CopyTo(Array array, int index)
        {
            if (array == null)
            {
                throw new ArgumentNullException("dest", "Value cannot be null.");
            }

            if (index < 0)
            {
                throw new ArgumentOutOfRangeException("dstIndex", "Number was less than the array's lower bound in the first dimension.");
            }

            if (index + Count > array.Length)
            {
                throw new ArgumentException("Destination array was not long enough. Check destIndex and length, and the array's lower bounds.");
            }

            ILargeCollection AsCollection = Items as ILargeCollection;

            AsCollection.CopyTo(array, index);
        }
Пример #4
0
#pragma warning disable SA1600
        void ILargeCollection.CopyTo(Array array, int arrayIndex)
#pragma warning restore SA1600
        {
            if (array == null)
            {
                throw new ArgumentNullException(nameof(array), "Value cannot be null.");
            }

            if (arrayIndex < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(arrayIndex), "Number was less than the array's lower bound in the first dimension.");
            }

            if (arrayIndex + Count > array.Length)
            {
                throw new ArgumentException("Destination array was not long enough. Check " + nameof(arrayIndex) + " and length, and the array's lower bounds.");
            }

            ILargeCollection AsCollection = (ILargeCollection)Items;

            AsCollection.CopyTo(array, arrayIndex);
        }
Пример #5
0
#pragma warning disable SA1600
        void ILargeCollection.CopyTo(Array array, int arrayIndex)
#pragma warning restore SA1600
        {
            if (array == null)
            {
                throw new ArgumentNullException(nameof(array));
            }

            if (arrayIndex < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(arrayIndex));
            }

            if (arrayIndex + Count > array.Length)
            {
                throw new ArgumentException();
            }

            ILargeCollection AsCollection = (ILargeCollection)Items;

            AsCollection.CopyTo(array, arrayIndex);
        }