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

◆ Insert() [2/2]

virtual void System.Collections.ArrayList.Insert ( int index,
object? value )
inlinevirtualinherited

Implements System.Collections.IList.

Definition at line 2499 of file ArrayList.cs.

2500 {
2501 if (index < 0 || index > _size)
2502 {
2503 throw new ArgumentOutOfRangeException("index", SR.ArgumentOutOfRange_Index);
2504 }
2505 if (_size == _items.Length)
2506 {
2507 EnsureCapacity(_size + 1);
2508 }
2509 if (index < _size)
2510 {
2511 Array.Copy(_items, index, _items, index + 1, _size - index);
2512 }
2513 _items[index] = value;
2514 _size++;
2515 _version++;
2516 }

References System.Collections.ArrayList._items, System.Collections.ArrayList._size, System.Collections.ArrayList._version, System.SR.ArgumentOutOfRange_Index, System.Array.Copy(), System.Collections.ArrayList.EnsureCapacity(), System.index, and System.value.

Referenced by System.Collections.ArrayList.Range.Add(), System.ComponentModel.Design.Serialization.ContextStack.Append(), System.Data.DataColumnCollection.ArrayAdd(), System.Collections.CollectionBase.Insert(), System.Collections.ArrayList.SyncArrayList.Insert(), System.Collections.ArrayList.Range.Insert(), System.Collections.Specialized.StringCollection.Insert(), System.Data.DataColumnCollection.MoveTo(), System.Collections.CollectionBase.Remove(), and System.Collections.CollectionBase.RemoveAt().