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

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

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

Definition at line 8380 of file Enumerable.cs.

8380 : notnull
8381 {
8382 if (source == null)
8383 {
8384 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
8385 }
8386 if (keySelector == null)
8387 {
8388 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.keySelector);
8389 }
8390 if (elementSelector == null)
8391 {
8392 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.elementSelector);
8393 }
8394 int num = 0;
8396 {
8397 num = collection.Count;
8398 if (num == 0)
8399 {
8401 }
8402 if (collection is TSource[] source2)
8403 {
8405 }
8407 {
8409 }
8410 }
8412 foreach (TSource item in source)
8413 {
8415 }
8416 return dictionary;
8417 }
static Dictionary< TKey, TElement > ToDictionary< TSource, TKey, TElement >(this IEnumerable< TSource > source, Func< TSource, TKey > keySelector, Func< TSource, TElement > elementSelector)

References System.collection, System.comparer, System.dictionary, System.Linq.elementSelector, System.item, System.Linq.keySelector, System.Linq.source, System.Linq.ThrowHelper.ThrowArgumentNullException(), and System.Linq.Enumerable.ToDictionary< TSource, TKey, TElement >().