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

◆ ToImmutableSortedDictionary< TSource, TKey, TValue >() [3/3]

static ImmutableSortedDictionary< TKey, TValue > System.Collections.Immutable.ImmutableSortedDictionary< TKey, TValue >.ToImmutableSortedDictionary< TSource, TKey, TValue > ( this IEnumerable< TSource > source,
Func< TSource, TKey > keySelector,
Func< TSource, TValue > elementSelector,
IComparer< TKey >? keyComparer,
IEqualityComparer< TValue >? valueComparer )
inlinestatic
Type Constraints
TKey :notnull 

Definition at line 57 of file ImmutableSortedDictionary.cs.

57 : notnull
58 {
61 Requires.NotNull(source, "source");
62 Requires.NotNull(keySelector2, "keySelector");
63 Requires.NotNull(elementSelector2, "elementSelector");
64 return ImmutableSortedDictionary<TKey, TValue>.Empty.WithComparers(keyComparer, valueComparer).AddRange(source.Select((TSource element) => new KeyValuePair<TKey, TValue>(keySelector2(element), elementSelector2(element))));
65 }
void AddRange(IEnumerable< KeyValuePair< TKey, TValue > > collection)

References System.Collections.Generic.Dictionary< TKey, TValue >.AddRange(), System.Linq.elementSelector, System.Linq.keySelector, and System.source.