Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ InsertRange()

virtual void System.Collections.ArrayList.InsertRange ( int index,
ICollection c )
inlinevirtual

Reimplemented in System.Collections.ArrayList.IListWrapper, System.Collections.ArrayList.SyncArrayList, System.Collections.ArrayList.FixedSizeArrayList, System.Collections.ArrayList.ReadOnlyArrayList, and System.Collections.ArrayList.Range.

Definition at line 2518 of file ArrayList.cs.

2519 {
2520 if (c == null)
2521 {
2522 throw new ArgumentNullException("c", SR.ArgumentNull_Collection);
2523 }
2524 if (index < 0 || index > _size)
2525 {
2526 throw new ArgumentOutOfRangeException("index", SR.ArgumentOutOfRange_Index);
2527 }
2528 int count = c.Count;
2529 if (count > 0)
2530 {
2532 if (index < _size)
2533 {
2534 Array.Copy(_items, index, _items, index + count, _size - index);
2535 }
2536 object[] array = new object[count];
2537 c.CopyTo(array, 0);
2538 array.CopyTo(_items, index);
2539 _size += count;
2540 _version++;
2541 }
2542 }

References System.Collections.ArrayList._items, System.Collections.ArrayList._size, System.Collections.ArrayList._version, System.SR.ArgumentNull_Collection, System.SR.ArgumentOutOfRange_Index, System.array, System.Array.Copy(), System.Collections.ICollection.CopyTo(), System.count, System.Collections.ICollection.Count, System.Collections.ArrayList.EnsureCapacity(), and System.index.

Referenced by System.Collections.ArrayList.Range.AddRange(), System.Collections.ArrayList.AddRange(), System.Collections.ArrayList.SyncArrayList.InsertRange(), and System.Collections.ArrayList.Range.InsertRange().