示例#1
0
文件: Deque`1.cs 项目: urish/M3D
        public void RemoveRange(int offset, int count)
        {
            Deque <T> .CheckRangeArguments(Count, offset, count);

            if (count == 0)
            {
                return;
            }

            DoRemoveRange(offset, count);
        }
示例#2
0
文件: Deque`1.cs 项目: urish/M3D
        void ICollection <T> .CopyTo(T[] array, int arrayIndex)
        {
            if (array == null)
            {
                throw new ArgumentNullException(nameof(array), "Array is null");
            }

            var count = Count;

            Deque <T> .CheckRangeArguments(array.Length, arrayIndex, count);

            for (var index = 0; index != count; ++index)
            {
                array[arrayIndex + index] = this[index];
            }
        }
示例#3
0
文件: Deque`1.cs 项目: urish/M3D
        void ICollection.CopyTo(Array array, int index)
        {
            if (array == null)
            {
                throw new ArgumentNullException(nameof(array), "Destination array cannot be null.");
            }

            Deque <T> .CheckRangeArguments(array.Length, index, Count);

            for (var index1 = 0; index1 != Count; ++index1)
            {
                try
                {
                    array.SetValue(this[index1], index + index1);
                }
                catch (InvalidCastException ex)
                {
                    throw new ArgumentException("Destination array is of incorrect type.", ex);
                }
            }
        }