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

◆ CopyTo()

void System.Collections.Specialized.NameValueCollection.CopyTo ( Array dest,
int index )
inlineinherited

Implements System.Collections.ICollection.

Definition at line 165 of file NameValueCollection.cs.

166 {
167 if (dest == null)
168 {
169 throw new ArgumentNullException("dest");
170 }
171 if (dest.Rank != 1)
172 {
173 throw new ArgumentException(System.SR.Arg_MultiRank, "dest");
174 }
175 if (index < 0)
176 {
177 throw new ArgumentOutOfRangeException("index", index, System.SR.ArgumentOutOfRange_NeedNonNegNum_Index);
178 }
179 if (dest.Length - index < Count)
180 {
182 }
183 int count = Count;
184 if (_all == null)
185 {
186 string[] array = new string[count];
187 for (int i = 0; i < count; i++)
188 {
189 array[i] = Get(i);
190 dest.SetValue(array[i], i + index);
191 }
192 _all = array;
193 }
194 else
195 {
196 for (int j = 0; j < count; j++)
197 {
198 dest.SetValue(_all[j], j + index);
199 }
200 }
201 }
static string Arg_MultiRank
Definition SR.cs:24
static string ArgumentOutOfRange_NeedNonNegNum_Index
Definition SR.cs:18
static string Arg_InsufficientSpace
Definition SR.cs:26
Definition SR.cs:7

References System.Collections.Specialized.NameValueCollection._all, System.SR.Arg_InsufficientSpace, System.SR.Arg_MultiRank, System.SR.ArgumentOutOfRange_NeedNonNegNum_Index, System.array, System.Collections.Specialized.NameObjectCollectionBase.Count, System.count, System.Runtime.Serialization.Dictionary, System.Collections.Specialized.NameValueCollection.Get(), and System.index.