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

◆ CopyTo()

void ICollection. System.Collections.ListDictionaryInternal.NodeKeyValueCollection.CopyTo ( Array array,
int index )
inlineprivate

Implements System.Collections.ICollection.

Definition at line 189 of file ListDictionaryInternal.cs.

190 {
191 if (array == null)
192 {
193 throw new ArgumentNullException("array");
194 }
195 if (array.Rank != 1)
196 {
197 throw new ArgumentException(SR.Arg_RankMultiDimNotSupported);
198 }
199 if (index < 0)
200 {
201 throw new ArgumentOutOfRangeException("index", SR.ArgumentOutOfRange_NeedNonNegNum);
202 }
203 if (array.Length - index < list.Count)
204 {
205 throw new ArgumentException(SR.ArgumentOutOfRange_Index, "index");
206 }
207 for (DictionaryNode dictionaryNode = list.head; dictionaryNode != null; dictionaryNode = dictionaryNode.next)
208 {
209 array.SetValue(isKeys ? dictionaryNode.key : dictionaryNode.value, index);
210 index++;
211 }
212 }

References System.SR.Arg_RankMultiDimNotSupported, System.SR.ArgumentOutOfRange_Index, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.array, System.Collections.ListDictionaryInternal.Count, System.Collections.ListDictionaryInternal.head, System.index, System.Collections.ListDictionaryInternal.NodeKeyValueCollection.isKeys, and System.Collections.ListDictionaryInternal.NodeKeyValueCollection.list.