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

◆ CopyTo()

virtual void System.Collections.SortedList.CopyTo ( Array array,
int arrayIndex )
inlinevirtual

Implements System.Collections.ICollection.

Reimplemented in System.Collections.SortedList.SyncSortedList.

Definition at line 756 of file SortedList.cs.

757 {
758 if (array == null)
759 {
760 throw new ArgumentNullException("array", System.SR.ArgumentNull_Array);
761 }
762 if (array.Rank != 1)
763 {
765 }
766 if (arrayIndex < 0)
767 {
768 throw new ArgumentOutOfRangeException("arrayIndex", System.SR.ArgumentOutOfRange_NeedNonNegNum);
769 }
770 if (array.Length - arrayIndex < Count)
771 {
773 }
774 for (int i = 0; i < Count; i++)
775 {
776 DictionaryEntry dictionaryEntry = new DictionaryEntry(keys[i], values[i]);
777 array.SetValue(dictionaryEntry, i + arrayIndex);
778 }
779 }
static string Arg_ArrayPlusOffTooSmall
Definition SR.cs:16
static string ArgumentNull_Array
Definition SR.cs:24
static string Arg_RankMultiDimNotSupported
Definition SR.cs:18
static string ArgumentOutOfRange_NeedNonNegNum
Definition SR.cs:32
Definition SR.cs:7

References System.SR.Arg_ArrayPlusOffTooSmall, System.SR.Arg_RankMultiDimNotSupported, System.SR.ArgumentNull_Array, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.array, System.arrayIndex, System.Collections.SortedList.Count, System.Collections.SortedList.keys, and System.Collections.SortedList.values.

Referenced by System.Collections.SortedList.SyncSortedList.CopyTo().