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

◆ CopyTo() [1/2]

void ICollection. System.Collections.Generic.LinkedList< T >.CopyTo ( Array array,
int index )
inlineprivate

Definition at line 522 of file LinkedList.cs.

523 {
524 if (array == null)
525 {
526 throw new ArgumentNullException("array");
527 }
528 if (array.Rank != 1)
529 {
531 }
532 if (array.GetLowerBound(0) != 0)
533 {
535 }
536 if (index < 0)
537 {
538 throw new ArgumentOutOfRangeException("index", index, System.SR.ArgumentOutOfRange_NeedNonNegNum);
539 }
540 if (array.Length - index < Count)
541 {
543 }
544 if (array is T[] array2)
545 {
547 return;
548 }
549 if (!(array is object[] array3))
550 {
552 }
553 LinkedListNode<T> next = head;
554 try
555 {
556 if (next != null)
557 {
558 do
559 {
560 array3[index++] = next.item;
561 next = next.next;
562 }
563 while (next != head);
564 }
565 }
566 catch (ArrayTypeMismatchException)
567 {
569 }
570 }
void CopyTo(T[] array, int index)
static string Argument_InvalidArrayType
Definition SR.cs:54
static string Arg_NonZeroLowerBound
Definition SR.cs:14
static string Arg_RankMultiDimNotSupported
Definition SR.cs:18
static string Arg_InsufficientSpace
Definition SR.cs:26
static string ArgumentOutOfRange_NeedNonNegNum
Definition SR.cs:32
Definition SR.cs:7

References System.SR.Arg_InsufficientSpace, System.SR.Arg_NonZeroLowerBound, System.SR.Arg_RankMultiDimNotSupported, System.SR.Argument_InvalidArrayType, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.array, System.Collections.Generic.LinkedList< T >.CopyTo(), System.Collections.Generic.LinkedList< T >.Count, System.Collections.Generic.LinkedList< T >.head, and System.index.