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

◆ ToDictionary< TSource, TKey, TElement >() [2/2]

static Dictionary< TKey, TElement > System.Linq.ParallelEnumerable.ToDictionary< TSource, TKey, TElement > ( this ParallelQuery< TSource > source,
Func< TSource, TKey > keySelector,
Func< TSource, TElement > elementSelector,
IEqualityComparer< TKey >? comparer )
inlinestatic
Type Constraints
TKey :notnull 

Definition at line 1812 of file ParallelEnumerable.cs.

1812 : notnull
1813 {
1814 if (source == null)
1815 {
1816 throw new ArgumentNullException("source");
1817 }
1818 if (keySelector == null)
1819 {
1820 throw new ArgumentNullException("keySelector");
1821 }
1822 if (elementSelector == null)
1823 {
1824 throw new ArgumentNullException("elementSelector");
1825 }
1828 using (enumerator)
1829 {
1830 while (enumerator.MoveNext())
1831 {
1832 TSource current = enumerator.Current;
1833 try
1834 {
1835 dictionary.Add(keySelector(current), elementSelector(current));
1836 }
1837 catch (Exception ex)
1838 {
1839 throw new AggregateException(ex);
1840 }
1841 }
1842 return dictionary;
1843 }
1844 }
void Add(TKey key, TValue value)

References System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.comparer, System.dictionary, System.Linq.elementSelector, System.Collections.Generic.Dictionary< TKey, TValue >.GetEnumerator(), System.Linq.keySelector, and System.Linq.source.