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

◆ CopyTo() [3/3]

override void System.Collections.ArrayList.IListWrapper.CopyTo ( int index,
Array array,
int arrayIndex,
int count )
inlinevirtual

Reimplemented from System.Collections.ArrayList.

Definition at line 222 of file ArrayList.cs.

223 {
224 if (array == null)
225 {
226 throw new ArgumentNullException("array");
227 }
228 if (index < 0 || arrayIndex < 0)
229 {
230 throw new ArgumentOutOfRangeException((index < 0) ? "index" : "arrayIndex", SR.ArgumentOutOfRange_NeedNonNegNum);
231 }
232 if (count < 0)
233 {
234 throw new ArgumentOutOfRangeException("count", SR.ArgumentOutOfRange_NeedNonNegNum);
235 }
236 if (array.Length - arrayIndex < count)
237 {
238 throw new ArgumentException(SR.Argument_InvalidOffLen);
239 }
240 if (array.Rank != 1)
241 {
242 throw new ArgumentException(SR.Arg_RankMultiDimNotSupported, "array");
243 }
244 if (_list.Count - index < count)
245 {
246 throw new ArgumentException(SR.Argument_InvalidOffLen);
247 }
248 for (int i = index; i < index + count; i++)
249 {
250 array.SetValue(_list[i], arrayIndex++);
251 }
252 }

References System.Collections.ArrayList.IListWrapper._list, System.SR.Arg_RankMultiDimNotSupported, System.SR.Argument_InvalidOffLen, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.array, System.arrayIndex, System.count, System.Collections.ICollection.Count, and System.index.