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

◆ InsertRange()

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

Reimplemented from System.Collections.ArrayList.

Definition at line 321 of file ArrayList.cs.

322 {
323 if (c == null)
324 {
325 throw new ArgumentNullException("c", SR.ArgumentNull_Collection);
326 }
327 if (index < 0 || index > Count)
328 {
329 throw new ArgumentOutOfRangeException("index", SR.ArgumentOutOfRange_Index);
330 }
331 if (c.Count <= 0)
332 {
333 return;
334 }
335 if (_list is ArrayList arrayList)
336 {
337 arrayList.InsertRange(index, c);
338 }
339 else
340 {
341 IEnumerator enumerator = c.GetEnumerator();
342 while (enumerator.MoveNext())
343 {
344 _list.Insert(index++, enumerator.Current);
345 }
346 }
347 _version++;
348 }
void Insert(int index, object? value)

References System.Collections.ArrayList.IListWrapper._list, System.Collections.ArrayList._version, System.SR.ArgumentNull_Collection, System.SR.ArgumentOutOfRange_Index, System.Collections.ArrayList.IListWrapper.Count, System.Collections.ICollection.Count, System.Collections.IEnumerator.Current, System.Collections.IEnumerable.GetEnumerator(), System.index, System.Collections.IList.Insert(), and System.Collections.IEnumerator.MoveNext().

Referenced by System.Collections.ArrayList.IListWrapper.AddRange().