11 types derived from FrozenDictionary
System.Collections.Immutable (11)
177 references to FrozenDictionary
dotnet (7)
Telemetry\Telemetry.cs (5)
20private FrozenDictionary<string, string>? _commonProperties = null;
21private FrozenDictionary<string, double>? _commonMeasurements = null;
158_commonMeasurements = FrozenDictionary<string, double>.Empty;
233(null, not null) => _commonMeasurements == FrozenDictionary<string, double>.Empty ? null : new Dictionary<string, double>(_commonMeasurements),
244(null, not null) => _commonProperties == FrozenDictionary<string, string>.Empty ? null : new Dictionary<string, string>(_commonProperties),
dotnet.Tests (1)
Microsoft.Analyzers.Extra.Tests (1)
Microsoft.AspNetCore.Components (1)
Microsoft.AspNetCore.Diagnostics.Middleware (3)
Microsoft.AspNetCore.Hosting (1)
Microsoft.AspNetCore.OutputCaching (2)
Microsoft.AspNetCore.Routing (9)
Microsoft.AspNetCore.Server.HttpSys (2)
Microsoft.AspNetCore.Server.IIS (2)
Microsoft.AspNetCore.Shared.Tests (2)
Microsoft.Build (23)
Microsoft.Build.Tasks.Core (5)
Microsoft.CodeAnalysis.Features (2)
Microsoft.CodeAnalysis.LanguageServer.Protocol (17)
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\RequestExecutionQueue.cs (6)
76private readonly FrozenDictionary<string, FrozenDictionary<string, Lazy<(RequestHandlerMetadata Metadata, IMethodHandler Handler, MethodInfo MethodInfo)>>> _handlerInfoMap;
94private static FrozenDictionary<string, FrozenDictionary<string, Lazy<(RequestHandlerMetadata, IMethodHandler, MethodInfo)>>> BuildHandlerMap(AbstractHandlerProvider handlerProvider, AbstractTypeRefResolver typeRefResolver)
96var genericMethodMap = new Dictionary<string, FrozenDictionary<string, Lazy<(RequestHandlerMetadata, IMethodHandler, MethodInfo)>>>();
415var handlersForMethod = _handlerInfoMap[work.MethodName];
Microsoft.CodeAnalysis.Workspaces (8)
Microsoft.CommonLanguageServerProtocol.Framework.Package (11)
RequestExecutionQueue.cs (6)
76private readonly FrozenDictionary<string, FrozenDictionary<string, Lazy<(RequestHandlerMetadata Metadata, IMethodHandler Handler, MethodInfo MethodInfo)>>> _handlerInfoMap;
94private static FrozenDictionary<string, FrozenDictionary<string, Lazy<(RequestHandlerMetadata, IMethodHandler, MethodInfo)>>> BuildHandlerMap(AbstractHandlerProvider handlerProvider, AbstractTypeRefResolver typeRefResolver)
96var genericMethodMap = new Dictionary<string, FrozenDictionary<string, Lazy<(RequestHandlerMetadata, IMethodHandler, MethodInfo)>>>();
415var handlersForMethod = _handlerInfoMap[work.MethodName];
Microsoft.Extensions.Compliance.Redaction (2)
Microsoft.Extensions.Diagnostics.ExceptionSummarization (3)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (2)
Microsoft.Extensions.Http.Diagnostics (14)
Latency\Internal\HttpRequestLatencyListener.cs (8)
145private readonly FrozenDictionary<string, FrozenDictionary<string, CheckpointToken>> _eventToCheckpointTokenMap;
146private readonly FrozenDictionary<string, FrozenDictionary<string, MeasureToken>> _eventToMeasureTokenMap;
174_eventToCheckpointTokenMap = new Dictionary<string, FrozenDictionary<string, CheckpointToken>>
181_eventToMeasureTokenMap = new Dictionary<string, FrozenDictionary<string, MeasureToken>>
189if (eventName != null && _eventToCheckpointTokenMap.TryGetValue(eventSourceName, out var events))
202if (eventName != null && _eventToMeasureTokenMap.TryGetValue(eventSourceName, out var events))
Microsoft.Extensions.Telemetry (1)
MSBuild (5)
System.Collections.Immutable (53)
System\Collections\Frozen\FrozenDictionary.cs (40)
15/// Provides a set of initialization methods for instances of the <see cref="FrozenDictionary{TKey, TValue}"/> class.
19/// <summary>Creates a <see cref="FrozenDictionary{TKey, TValue}"/> with the specified key/value pairs.</summary>
27/// <returns>A <see cref="FrozenDictionary{TKey, TValue}"/> that contains the specified keys and values.</returns>
28public static FrozenDictionary<TKey, TValue> Create<TKey, TValue>(params ReadOnlySpan<KeyValuePair<TKey, TValue>> source)
32/// <summary>Creates a <see cref="FrozenDictionary{TKey, TValue}"/> with the specified key/value pairs.</summary>
41/// <returns>A <see cref="FrozenDictionary{TKey, TValue}"/> that contains the specified keys and values.</returns>
42public static FrozenDictionary<TKey, TValue> Create<TKey, TValue>(IEqualityComparer<TKey>? comparer, params ReadOnlySpan<KeyValuePair<TKey, TValue>> source)
49return ReferenceEquals(comparer, FrozenDictionary<TKey, TValue>.Empty.Comparer) ?
50FrozenDictionary<TKey, TValue>.Empty :
63/// <summary>Creates a <see cref="FrozenDictionary{TKey, TValue}"/> with the specified key/value pairs.</summary>
72/// <returns>A <see cref="FrozenDictionary{TKey, TValue}"/> that contains the specified keys and values.</returns>
73public static FrozenDictionary<TKey, TValue> ToFrozenDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source, IEqualityComparer<TKey>? comparer = null)
78/// <summary>Creates a <see cref="FrozenDictionary{TKey, TSource}"/> from an <see cref="IEnumerable{TSource}"/> according to specified key selector function.</summary>
81/// <param name="source">An <see cref="IEnumerable{TSource}"/> from which to create a <see cref="FrozenDictionary{TKey, TSource}"/>.</param>
84/// <returns>A <see cref="FrozenDictionary{TKey, TElement}"/> that contains the keys and values selected from the input sequence.</returns>
85public static FrozenDictionary<TKey, TSource> ToFrozenDictionary<TSource, TKey>(
90/// <summary>Creates a <see cref="FrozenDictionary{TKey, TElement}"/> from an <see cref="IEnumerable{TSource}"/> according to specified key selector and element selector functions.</summary>
94/// <param name="source">An <see cref="IEnumerable{TSource}"/> from which to create a <see cref="FrozenDictionary{TKey, TElement}"/>.</param>
98/// <returns>A <see cref="FrozenDictionary{TKey, TElement}"/> that contains the keys and values selected from the input sequence.</returns>
99public static FrozenDictionary<TKey, TElement> ToFrozenDictionary<TSource, TKey, TElement>(
105/// Extracts from the source either an existing <see cref="FrozenDictionary{TKey,TValue}"/> instance or a <see cref="Dictionary{TKey,TValue}"/>
109/// If <paramref name="source"/> is already a <see cref="FrozenDictionary{TKey,TValue}"/> with the same <paramref name="comparer"/>, returns that instance.
110/// If <paramref name="source"/> is empty, returns an empty <see cref="FrozenDictionary{TKey,TValue}"/> with the specified <paramref name="comparer"/>.
114private static FrozenDictionary<TKey, TValue>? GetExistingFrozenOrNewDictionary<TKey, TValue>(
123if (source is FrozenDictionary<TKey, TValue> fd && fd.Comparer.Equals(comparer))
146return ReferenceEquals(comparer, FrozenDictionary<TKey, TValue>.Empty.Comparer) ?
147FrozenDictionary<TKey, TValue>.Empty :
157private static FrozenDictionary<TKey, TValue> CreateFromDictionary<TKey, TValue>(Dictionary<TKey, TValue> source)
182return (FrozenDictionary<TKey, TValue>)(object)new SmallValueTypeComparableFrozenDictionary<TKey, TValue>(source);
186return (FrozenDictionary<TKey, TValue>)(object)new SmallValueTypeDefaultComparerFrozenDictionary<TKey, TValue>(source);
194return (FrozenDictionary<TKey, TValue>)(object)new Int32FrozenDictionary<TValue>((Dictionary<int, TValue>)(object)source);
225FrozenDictionary<string, TValue>? frozenDictionary = LengthBucketsFrozenDictionary<TValue>.CreateLengthBucketsFrozenDictionaryIfAppropriate(keys, values, stringComparer, minLength, maxLength);
228return (FrozenDictionary<TKey, TValue>)(object)frozenDictionary;
280return (FrozenDictionary<TKey, TValue>)(object)frozenDictionary;
299/// <see cref="FrozenDictionary{TKey, TValue}"/> is immutable and is optimized for situations where a dictionary
303/// the remainder of the life of the application. <see cref="FrozenDictionary{TKey, TValue}"/> should only be
316/// <summary>Gets an empty <see cref="FrozenDictionary{TKey, TValue}"/>.</summary>
317public static FrozenDictionary<TKey, TValue> Empty { get; } = new EmptyFrozenDictionary<TKey, TValue>(EqualityComparer<TKey>.Default);
534internal delegate ref readonly TValue AlternateLookupDelegate<TAlternateKey>(FrozenDictionary<TKey, TValue> dictionary, TAlternateKey key)
671/// <summary>Enumerates the elements of a <see cref="FrozenDictionary{TKey, TValue}"/>.</summary>