6 instantiations of ImmutableDictionary
System.Collections.Immutable (6)
System\Collections\Immutable\ImmutableDictionary_2.cs (6)
23public static readonly ImmutableDictionary<TKey, TValue> Empty = new ImmutableDictionary<TKey, TValue>(); 442return new ImmutableDictionary<TKey, TValue>(_root, comparers, _count); 448var set = new ImmutableDictionary<TKey, TValue>(comparers); 834: new ImmutableDictionary<TKey, TValue>(comparers); 1021return new ImmutableDictionary<TKey, TValue>(root, comparers, count); 1039return root.IsEmpty ? this.Clear() : new ImmutableDictionary<TKey, TValue>(root, _comparers, adjustedCountIfDifferentRoot);
334 references to ImmutableDictionary
ILLink.RoslynAnalyzer (10)
DataFlow\LocalDataFlowAnalysis.cs (3)
92 var lValueFlowCaptures = LValueFlowCapturesProvider.CreateLValueFlowCaptures (cfg); 100 var lValueFlowCaptures = LValueFlowCapturesProvider.CreateLValueFlowCaptures (cfg); 112 ImmutableDictionary<CaptureId, FlowCaptureKind> lValueFlowCaptures,
DataFlow\LocalDataFlowVisitor.cs (2)
49 private readonly ImmutableDictionary<CaptureId, FlowCaptureKind> lValueFlowCaptures; 64 ImmutableDictionary<CaptureId, FlowCaptureKind> lValueFlowCaptures,
DataFlow\LValueFlowCaptureProvider.cs (3)
51 public static ImmutableDictionary<CaptureId, FlowCaptureKind> CreateLValueFlowCaptures (ControlFlowGraph cfg) 60 ImmutableDictionary<CaptureId, FlowCaptureKind>.Builder? lvalueFlowCaptureIdBuilder = null; 85 return lvalueFlowCaptureIdBuilder != null ? lvalueFlowCaptureIdBuilder.ToImmutable () : ImmutableDictionary<CaptureId, FlowCaptureKind>.Empty;
TrimAnalysis\TrimAnalysisVisitor.cs (1)
51 ImmutableDictionary<CaptureId, FlowCaptureKind> lValueFlowCaptures,
TrimAnalysis\TrimDataFlowAnalysis.cs (1)
58 ImmutableDictionary<CaptureId, FlowCaptureKind> lValueFlowCaptures,
Microsoft.AspNetCore.Analyzers (2)
StartupAnalysis.cs (2)
11private readonly ImmutableDictionary<INamedTypeSymbol, ImmutableArray<object>> _analysesByType; 15ImmutableDictionary<INamedTypeSymbol, ImmutableArray<object>> analysesByType)
Microsoft.AspNetCore.Components.Endpoints (14)
FormMapping\Converters\DictionaryAdapters\ImmutableDictionaryBufferAdapter.cs (10)
9: IDictionaryBufferAdapter<ImmutableDictionary<TKey, TValue>, ImmutableDictionary<TKey, TValue>.Builder, TKey, TValue> 12public static ImmutableDictionary<TKey, TValue>.Builder Add(ref ImmutableDictionary<TKey, TValue>.Builder buffer, TKey key, TValue value) 18public static ImmutableDictionary<TKey, TValue>.Builder CreateBuffer() => ImmutableDictionary.CreateBuilder<TKey, TValue>(); 20public static ImmutableDictionary<TKey, TValue> ToResult(ImmutableDictionary<TKey, TValue>.Builder buffer) => buffer.ToImmutable(); 27ImmutableDictionary<TKey, TValue>, 29ImmutableDictionary<TKey, TValue>.Builder, 32ImmutableDictionary<TKey, TValue>.Builder,
FormMapping\Factories\Dictionary\TypedDictionaryConverterFactory.cs (4)
46var _ when type == (typeof(ImmutableDictionary<TKey, TValue>)) => true, 114var _ when type == (typeof(ImmutableDictionary<TKey, TValue>)) => 116ImmutableDictionary<TKey, TValue>, 118ImmutableDictionary<TKey, TValue>.Builder,
Microsoft.AspNetCore.Components.Endpoints.Tests (6)
Binding\FormDataMapperTests.cs (6)
913var expected = ImmutableDictionary.CreateRange(new Dictionary<int, int>() { [0] = 10, [1] = 11, [2] = 12, [3] = 13, [4] = 14, [5] = 15, [6] = 16, [7] = 17, [8] = 18, [9] = 19, }); 914CanDeserialize_Dictionary<ImmutableDictionary<int, int>, ImmutableDictionary<int, int>, int, int>(expected); 929var expected = ImmutableDictionary.CreateRange(new Dictionary<int, int>() { [0] = 10, [1] = 11, [2] = 12, [3] = 13, [4] = 14, [5] = 15, [6] = 16, [7] = 17, [8] = 18, [9] = 19, }); 951var dictionary = Assert.IsType<ImmutableDictionary<int, int>>(result);
Microsoft.AspNetCore.Http.Extensions (14)
src\Components\Endpoints\src\FormMapping\Converters\DictionaryAdapters\ImmutableDictionaryBufferAdapter.cs (10)
9: IDictionaryBufferAdapter<ImmutableDictionary<TKey, TValue>, ImmutableDictionary<TKey, TValue>.Builder, TKey, TValue> 12public static ImmutableDictionary<TKey, TValue>.Builder Add(ref ImmutableDictionary<TKey, TValue>.Builder buffer, TKey key, TValue value) 18public static ImmutableDictionary<TKey, TValue>.Builder CreateBuffer() => ImmutableDictionary.CreateBuilder<TKey, TValue>(); 20public static ImmutableDictionary<TKey, TValue> ToResult(ImmutableDictionary<TKey, TValue>.Builder buffer) => buffer.ToImmutable(); 27ImmutableDictionary<TKey, TValue>, 29ImmutableDictionary<TKey, TValue>.Builder, 32ImmutableDictionary<TKey, TValue>.Builder,
src\Components\Endpoints\src\FormMapping\Factories\Dictionary\TypedDictionaryConverterFactory.cs (4)
46var _ when type == (typeof(ImmutableDictionary<TKey, TValue>)) => true, 114var _ when type == (typeof(ImmutableDictionary<TKey, TValue>)) => 116ImmutableDictionary<TKey, TValue>, 118ImmutableDictionary<TKey, TValue>.Builder,
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
EndpointModelMetadata.cs (1)
18public override IReadOnlyDictionary<object, object> AdditionalValues { get; } = ImmutableDictionary<object, object>.Empty;
Microsoft.AspNetCore.Server.HttpSys (1)
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
749return ImmutableDictionary<int, ReadOnlyMemory<byte>>.Empty;
Microsoft.AspNetCore.Server.IIS (1)
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
749return ImmutableDictionary<int, ReadOnlyMemory<byte>>.Empty;
Microsoft.AspNetCore.Shared.Tests (1)
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
749return ImmutableDictionary<int, ReadOnlyMemory<byte>>.Empty;
Microsoft.Build (25)
Collections\CopyOnWritePropertyDictionary.cs (4)
42private static readonly ImmutableDictionary<string, T> NameComparerDictionaryPrototype = ImmutableDictionary.Create<string, T>(MSBuildNameIgnoreCaseComparer.Default); 47private ImmutableDictionary<string, T> _backing; 153ImmutableDictionary<string, T> thisBacking = _backing; 154ImmutableDictionary<string, T> thatBacking = other._backing;
CopyOnWriteDictionary.cs (9)
37private static readonly ImmutableDictionary<string, V> NameComparerDictionaryPrototype = ImmutableDictionary.Create<string, V>(MSBuildNameIgnoreCaseComparer.Default); 44private static readonly ImmutableDictionary<string, V> OrdinalIgnoreCaseComparerDictionaryPrototype = ImmutableDictionary.Create<string, V>(StringComparer.OrdinalIgnoreCase); 52private ImmutableDictionary<string, V> _backing; 59_backing = ImmutableDictionary<string, V>.Empty; 80var b = GetInitialDictionary((IEqualityComparer<string>?)comparer); 85private static ImmutableDictionary<string, V> GetInitialDictionary(IEqualityComparer<string>? keyComparer) 236ImmutableDictionary<string, V> initial = _backing; 290ImmutableDictionary<string, V> initial = _backing; 386ImmutableDictionary<string, V> snapshot = _backing;
Evaluation\LazyItemEvaluator.cs (2)
467private static readonly ImmutableDictionary<string, LazyItemList> s_emptyIgnoreCase = ImmutableDictionary.Create<string, LazyItemList>(StringComparer.OrdinalIgnoreCase); 473public ImmutableDictionary<string, LazyItemList>.Builder ReferencedItemLists { get; } = Traits.Instance.EscapeHatches.UseCaseSensitiveItemNames ?
Evaluation\LazyItemEvaluator.LazyItemOperation.cs (1)
22private readonly ImmutableDictionary<string, LazyItemList> _referencedItemLists;
Graph\GraphBuilder.cs (3)
265ImmutableDictionary<string, string>.Builder solutionGlobalPropertiesBuilder = ImmutableDictionary.CreateBuilder( 308Dictionary<string, ImmutableDictionary<string, string>> globalPropertiesForProjectConfiguration = new(StringComparer.OrdinalIgnoreCase); 328if (!globalPropertiesForProjectConfiguration.TryGetValue(projectConfiguration.FullName, out ImmutableDictionary<string, string> projectGlobalProperties))
Graph\ProjectInterpretation.cs (6)
326var newProperties = defaultParts.Properties; 349public ImmutableDictionary<string, string> Properties { get; } 350public ImmutableDictionary<string, string> AdditionalProperties { get; } 354ImmutableDictionary<string, string> properties, 355ImmutableDictionary<string, string> additionalProperties, 430return ImmutableDictionary<string, string>.Empty;
Microsoft.Build.Engine.UnitTests (1)
Graph\GraphTestingUtilities.cs (1)
20public static readonly ImmutableDictionary<string, string> EmptyGlobalProperties = new Dictionary<string, string> { { PropertyNames.IsGraphBuild, "true" } }.ToImmutableDictionary();
Microsoft.Build.Framework (11)
ImmutableSegmentedDictionary`2.cs (3)
18/// best for <see cref="ImmutableDictionary{TKey, TValue}"/>.</para> 22/// <see cref="ImmutableDictionary{TKey, TValue}"/> is applicable in scenarios most like the scenarios where 32/// <description><see cref="ImmutableDictionary{TKey, TValue}"/> Complexity</description>
RoslynImmutableInterlocked.cs (8)
266/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue, TArg}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TArg, TValue}, TArg)"/> 286/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue})"/> 306/// <inheritdoc cref="ImmutableInterlocked.GetOrAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 334/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, Func{TKey, TValue}, Func{TKey, TValue, TValue})"/> 372/// <inheritdoc cref="ImmutableInterlocked.AddOrUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, Func{TKey, TValue, TValue})"/> 408/// <inheritdoc cref="ImmutableInterlocked.TryAdd{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue)"/> 434/// <inheritdoc cref="ImmutableInterlocked.TryUpdate{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, TValue, TValue)"/> 462/// <inheritdoc cref="ImmutableInterlocked.TryRemove{TKey, TValue}(ref ImmutableDictionary{TKey, TValue}, TKey, out TValue)"/>
Microsoft.Build.Tasks.Core (9)
CopyOnWriteDictionary.cs (9)
37private static readonly ImmutableDictionary<string, V> NameComparerDictionaryPrototype = ImmutableDictionary.Create<string, V>(MSBuildNameIgnoreCaseComparer.Default); 44private static readonly ImmutableDictionary<string, V> OrdinalIgnoreCaseComparerDictionaryPrototype = ImmutableDictionary.Create<string, V>(StringComparer.OrdinalIgnoreCase); 52private ImmutableDictionary<string, V> _backing; 59_backing = ImmutableDictionary<string, V>.Empty; 80var b = GetInitialDictionary((IEqualityComparer<string>?)comparer); 85private static ImmutableDictionary<string, V> GetInitialDictionary(IEqualityComparer<string>? keyComparer) 236ImmutableDictionary<string, V> initial = _backing; 290ImmutableDictionary<string, V> initial = _backing; 386ImmutableDictionary<string, V> snapshot = _backing;
Microsoft.Build.Utilities.Core (9)
CopyOnWriteDictionary.cs (9)
37private static readonly ImmutableDictionary<string, V> NameComparerDictionaryPrototype = ImmutableDictionary.Create<string, V>(MSBuildNameIgnoreCaseComparer.Default); 44private static readonly ImmutableDictionary<string, V> OrdinalIgnoreCaseComparerDictionaryPrototype = ImmutableDictionary.Create<string, V>(StringComparer.OrdinalIgnoreCase); 52private ImmutableDictionary<string, V> _backing; 59_backing = ImmutableDictionary<string, V>.Empty; 80var b = GetInitialDictionary((IEqualityComparer<string>?)comparer); 85private static ImmutableDictionary<string, V> GetInitialDictionary(IEqualityComparer<string>? keyComparer) 236ImmutableDictionary<string, V> initial = _backing; 290ImmutableDictionary<string, V> initial = _backing; 386ImmutableDictionary<string, V> snapshot = _backing;
Microsoft.DotNet.SignTool (4)
src\BatchSignInput.cs (2)
25internal ImmutableDictionary<SignedFileContentKey, ZipData> ZipDataMap; 33internal BatchSignInput(ImmutableArray<FileSignInfo> filesToSign, ImmutableDictionary<SignedFileContentKey, ZipData> zipDataMap, ImmutableArray<KeyValuePair<string, string>> filesToCopy)
src\ZipData.cs (2)
28internal ImmutableDictionary<string, ZipPart> NestedParts { get; } 30internal ZipData(FileSignInfo fileSignInfo, ImmutableDictionary<string, ZipPart> nestedBinaryParts)
Microsoft.Interop.ComInterfaceGenerator (22)
Analyzers\AddGeneratedComClassFixer.cs (4)
43protected override Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions) 48protected override string GetDiagnosticTitle(ImmutableDictionary<string, Option> selectedOptions) 57protected override ImmutableDictionary<string, Option> ParseOptionsFromDiagnostic(Diagnostic diagnostic) 59return ImmutableDictionary<string, Option>.Empty;
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (1)
139ImmutableDictionary<string, string>.Builder properties = ImmutableDictionary.CreateBuilder<string, string>();
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (3)
28protected override string GetDiagnosticTitle(ImmutableDictionary<string, Option> selectedOptions) 35protected override Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions) 43protected override ImmutableDictionary<string, Option> ParseOptionsFromDiagnostic(Diagnostic diagnostic)
ComInterfaceGenerator.cs (1)
333ImmutableDictionary<string, string>.Empty.Add(GeneratorDiagnosticProperties.AddMarshalAsAttribute, "Error"),
GeneratedComInterfaceAttributeData.cs (1)
64var args = attr.NamedArguments.ToImmutableDictionary();
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (11)
27protected virtual IEnumerable<ConvertToSourceGeneratedInteropFix> CreateAllFixesForDiagnosticOptions(SyntaxNode node, ImmutableDictionary<string, Option> options) 33protected abstract Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions); 35protected abstract string GetDiagnosticTitle(ImmutableDictionary<string, Option> selectedOptions); 59public static ImmutableDictionary<string, Option> ParseOptionsFromEquivalenceKey(string equivalenceKey) 61ImmutableDictionary<string, Option>.Builder options = ImmutableDictionary.CreateBuilder<string, Option>(); 86public static string CreateEquivalenceKeyFromOptions(string baseEquivalenceKey, ImmutableDictionary<string, Option> options) 97protected abstract ImmutableDictionary<string, Option> ParseOptionsFromDiagnostic(Diagnostic diagnostic); 123var options = ParseOptionsFromDiagnostic(diagnostic); 128var selectedOptions = fix.SelectedOptions.Add(Option.AllowUnsafe, new Option.Bool(true)); 157protected record struct ConvertToSourceGeneratedInteropFix(Func<DocumentEditor, CancellationToken, Task> ApplyFix, ImmutableDictionary<string, Option> SelectedOptions); 164var options = Option.ParseOptionsFromEquivalenceKey(fixAllContext.CodeActionEquivalenceKey);
VtableIndexStubGenerator.cs (1)
138var namedArguments = ImmutableDictionary.CreateRange(attrData.NamedArguments);
Microsoft.Interop.LibraryImportGenerator (24)
Analyzers\ConvertToLibraryImportAnalyzer.cs (1)
155ImmutableDictionary<string, string>.Builder properties = ImmutableDictionary.CreateBuilder<string, string>();
Analyzers\ConvertToLibraryImportFixer.cs (5)
37protected override string GetDiagnosticTitle(ImmutableDictionary<string, Option> selectedOptions) 56protected override ImmutableDictionary<string, Option> ParseOptionsFromDiagnostic(Diagnostic diagnostic) 71protected override IEnumerable<ConvertToSourceGeneratedInteropFix> CreateAllFixesForDiagnosticOptions(SyntaxNode node, ImmutableDictionary<string, Option> options) 78var selectedOptions = options.Remove(CharSetOption); 124protected override Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions)
Analyzers\CustomMarshallerAttributeAnalyzer.cs (2)
30public static ImmutableDictionary<string, string> CreateDiagnosticPropertiesForMissingMembersDiagnostic(MarshalMode mode, params string[] missingMemberNames) 33public static ImmutableDictionary<string, string> CreateDiagnosticPropertiesForMissingMembersDiagnostic(MarshalMode mode, IEnumerable<string> missingMemberNames)
Analyzers\DiagnosticReporter.cs (4)
12private readonly Action<DiagnosticDescriptor, ImmutableDictionary<string, string>, object[]> _diagnosticFactory; 14public DiagnosticReporter(Action<DiagnosticDescriptor, ImmutableDictionary<string, string>, object[]> createAndReportDiagnostic) 21public void CreateAndReportDiagnostic(DiagnosticDescriptor descriptor, params object[] messageArgs) => _diagnosticFactory(descriptor, ImmutableDictionary<string, string>.Empty, messageArgs); 23public void CreateAndReportDiagnostic(DiagnosticDescriptor descriptor, ImmutableDictionary<string, string> properties, params object[] messageArgs) => _diagnosticFactory(descriptor, properties, messageArgs);
LibraryImportGenerator.cs (1)
197ImmutableDictionary<string, TypedConstant> namedArguments = ImmutableDictionary.CreateRange(attrData.NamedArguments);
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (11)
27protected virtual IEnumerable<ConvertToSourceGeneratedInteropFix> CreateAllFixesForDiagnosticOptions(SyntaxNode node, ImmutableDictionary<string, Option> options) 33protected abstract Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions); 35protected abstract string GetDiagnosticTitle(ImmutableDictionary<string, Option> selectedOptions); 59public static ImmutableDictionary<string, Option> ParseOptionsFromEquivalenceKey(string equivalenceKey) 61ImmutableDictionary<string, Option>.Builder options = ImmutableDictionary.CreateBuilder<string, Option>(); 86public static string CreateEquivalenceKeyFromOptions(string baseEquivalenceKey, ImmutableDictionary<string, Option> options) 97protected abstract ImmutableDictionary<string, Option> ParseOptionsFromDiagnostic(Diagnostic diagnostic); 123var options = ParseOptionsFromDiagnostic(diagnostic); 128var selectedOptions = fix.SelectedOptions.Add(Option.AllowUnsafe, new Option.Bool(true)); 157protected record struct ConvertToSourceGeneratedInteropFix(Func<DocumentEditor, CancellationToken, Task> ApplyFix, ImmutableDictionary<string, Option> SelectedOptions); 164var options = Option.ParseOptionsFromEquivalenceKey(fixAllContext.CodeActionEquivalenceKey);
Microsoft.Interop.SourceGeneration (27)
DiagnosticExtensions.cs (8)
23ImmutableDictionary<string, string> properties, 45ImmutableDictionary<string, string> properties, 67ImmutableDictionary<string, string> properties, 106ImmutableDictionary<string, string> properties, 127ImmutableDictionary<string, string> properties, 149ImmutableDictionary<string, string> properties, 171ImmutableDictionary<string, string> properties, 210ImmutableDictionary<string, string> properties,
DiagnosticInfo.cs (2)
38public static DiagnosticInfo Create(DiagnosticDescriptor descriptor, Location location, ImmutableDictionary<string, string>? properties, params object?[] messageArgs) 50public static DiagnosticInfo Create(DiagnosticDescriptor descriptor, Location location, IEnumerable<Location>? additionalLocations, ImmutableDictionary<string, string>? properties, params object?[] messageArgs)
InteropAttributeData.cs (1)
55public static T WithValuesFromNamedArguments<T>(this T t, ImmutableDictionary<string, TypedConstant> namedArguments) where T : InteropAttributeCompilationData
ManualTypeMarshallingHelper.cs (1)
25ImmutableDictionary<MarshalMode, CustomTypeMarshallerData> Modes)
MarshalAsParser.cs (1)
135ImmutableDictionary<string, TypedConstant> namedArguments = ImmutableDictionary.CreateRange(attributeData.NamedArguments);
Marshalling\AttributedMarshallingModelGeneratorResolver.cs (2)
24private static readonly ImmutableDictionary<string, string> AddDisableRuntimeMarshallingAttributeProperties = 25ImmutableDictionary<string, string>.Empty.Add(GeneratorDiagnosticProperties.AddDisableRuntimeMarshallingAttribute, GeneratorDiagnosticProperties.AddDisableRuntimeMarshallingAttribute);
Marshalling\GeneratorDiagnostic.cs (2)
23public ImmutableDictionary<string, string> DiagnosticProperties { get; init; } = ImmutableDictionary<string, string>.Empty;
Marshalling\NoMarshallingInfoErrorResolver.cs (3)
33private NoMarshallingInfoErrorResolver(ImmutableDictionary<ManagedTypeInfo, string> customTypeToErrorMessageMap) 38public ImmutableDictionary<ManagedTypeInfo, string> CustomTypeToErrorMessageMap { get; } 40private static ImmutableDictionary<ManagedTypeInfo, string> DefaultTypeToErrorMessageMap(string stringMarshallingAttribute)
MarshallingAttributeInfo.cs (1)
165new CustomTypeMarshallers(ImmutableDictionary<MarshalMode, CustomTypeMarshallerData>.Empty.Add(
MarshalUsingAttributeParser.cs (1)
66ImmutableDictionary<string, TypedConstant> namedArgs = ImmutableDictionary.CreateRange(attributeData.NamedArguments);
SafeHandleMarshallingInfoProvider.cs (1)
85Modes = ImmutableDictionary<MarshalMode, CustomTypeMarshallerData>.Empty
UseSiteAttributeProvider.cs (2)
16private readonly ImmutableDictionary<int, UseSiteAttributeData> _useSiteAttributesByIndirectionDepth; 36ImmutableDictionary<int, UseSiteAttributeData>.Builder useSiteAttributesByIndirectionDepth = ImmutableDictionary.CreateBuilder<int, UseSiteAttributeData>();
ValueEqualityImmutableDictionary.cs (2)
11public record struct ValueEqualityImmutableDictionary<T, U>(ImmutableDictionary<T, U> Map) : IDictionary<T, U> 73public static ValueEqualityImmutableDictionary<TKey, TValue> ToValueEquals<TKey, TValue>(this ImmutableDictionary<TKey, TValue> source)
MSBuild (9)
CopyOnWriteDictionary.cs (9)
37private static readonly ImmutableDictionary<string, V> NameComparerDictionaryPrototype = ImmutableDictionary.Create<string, V>(MSBuildNameIgnoreCaseComparer.Default); 44private static readonly ImmutableDictionary<string, V> OrdinalIgnoreCaseComparerDictionaryPrototype = ImmutableDictionary.Create<string, V>(StringComparer.OrdinalIgnoreCase); 52private ImmutableDictionary<string, V> _backing; 59_backing = ImmutableDictionary<string, V>.Empty; 80var b = GetInitialDictionary((IEqualityComparer<string>?)comparer); 85private static ImmutableDictionary<string, V> GetInitialDictionary(IEqualityComparer<string>? keyComparer) 236ImmutableDictionary<string, V> initial = _backing; 290ImmutableDictionary<string, V> initial = _backing; 386ImmutableDictionary<string, V> snapshot = _backing;
Mvc.Api.Analyzers.Test (1)
ApiConventionAnalyzerIntegrationTest.cs (1)
311var specificDiagnosticOptions = compilationOptions.SpecificDiagnosticOptions.Add(
System.Collections.Immutable (141)
System\Collections\Immutable\IImmutableDictionaryInternal.cs (3)
9/// Determines whether the <see cref="ImmutableDictionary{TKey, TValue}"/> 13/// The value to locate in the <see cref="ImmutableDictionary{TKey, TValue}"/>. 17/// true if the <see cref="ImmutableDictionary{TKey, TValue}"/> contains
System\Collections\Immutable\ImmutableDictionary.cs (29)
11/// A set of initialization methods for instances of <see cref="ImmutableDictionary{TKey, TValue}"/>. 21public static ImmutableDictionary<TKey, TValue> Create<TKey, TValue>() where TKey : notnull 23return ImmutableDictionary<TKey, TValue>.Empty; 35public static ImmutableDictionary<TKey, TValue> Create<TKey, TValue>(IEqualityComparer<TKey>? keyComparer) where TKey : notnull 37return ImmutableDictionary<TKey, TValue>.Empty.WithComparers(keyComparer); 50public static ImmutableDictionary<TKey, TValue> Create<TKey, TValue>(IEqualityComparer<TKey>? keyComparer, IEqualityComparer<TValue>? valueComparer) where TKey : notnull 52return ImmutableDictionary<TKey, TValue>.Empty.WithComparers(keyComparer, valueComparer); 62public static ImmutableDictionary<TKey, TValue> CreateRange<TKey, TValue>(IEnumerable<KeyValuePair<TKey, TValue>> items) where TKey : notnull 64return ImmutableDictionary<TKey, TValue>.Empty.AddRange(items); 75public static ImmutableDictionary<TKey, TValue> CreateRange<TKey, TValue>(IEqualityComparer<TKey>? keyComparer, IEnumerable<KeyValuePair<TKey, TValue>> items) where TKey : notnull 77return ImmutableDictionary<TKey, TValue>.Empty.WithComparers(keyComparer).AddRange(items); 89public static ImmutableDictionary<TKey, TValue> CreateRange<TKey, TValue>(IEqualityComparer<TKey>? keyComparer, IEqualityComparer<TValue>? valueComparer, IEnumerable<KeyValuePair<TKey, TValue>> items) where TKey : notnull 91return ImmutableDictionary<TKey, TValue>.Empty.WithComparers(keyComparer, valueComparer).AddRange(items); 100public static ImmutableDictionary<TKey, TValue>.Builder CreateBuilder<TKey, TValue>() where TKey : notnull 112public static ImmutableDictionary<TKey, TValue>.Builder CreateBuilder<TKey, TValue>(IEqualityComparer<TKey>? keyComparer) where TKey : notnull 125public static ImmutableDictionary<TKey, TValue>.Builder CreateBuilder<TKey, TValue>(IEqualityComparer<TKey>? keyComparer, IEqualityComparer<TValue>? valueComparer) where TKey : notnull 142public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector, IEqualityComparer<TKey>? keyComparer, IEqualityComparer<TValue>? valueComparer) where TKey : notnull 148return ImmutableDictionary<TKey, TValue>.Empty.WithComparers(keyComparer, valueComparer) 157public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TKey, TValue>(this ImmutableDictionary<TKey, TValue>.Builder builder) where TKey : notnull 175public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector, IEqualityComparer<TKey>? keyComparer) where TKey : notnull 188public static ImmutableDictionary<TKey, TSource> ToImmutableDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector) where TKey : notnull 202public static ImmutableDictionary<TKey, TSource> ToImmutableDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? keyComparer) where TKey : notnull 217public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector) where TKey : notnull 231public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source, IEqualityComparer<TKey>? keyComparer, IEqualityComparer<TValue>? valueComparer) where TKey : notnull 235if (source is ImmutableDictionary<TKey, TValue> existingDictionary) 240return ImmutableDictionary<TKey, TValue>.Empty.WithComparers(keyComparer, valueComparer).AddRange(source); 251public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source, IEqualityComparer<TKey>? keyComparer) where TKey : notnull 263public static ImmutableDictionary<TKey, TValue> ToImmutableDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source) where TKey : notnull
System\Collections\Immutable\ImmutableDictionary_2.Builder.cs (26)
11/// Contains the inner <see cref="ImmutableDictionary{TKey, TValue}.Builder"/> class. 21/// While <see cref="ImmutableDictionary{TKey, TValue}.AddRange(IEnumerable{KeyValuePair{TKey, TValue}})"/> 52private ImmutableDictionary<TKey, TValue>? _immutable; 65/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}.Builder"/> class. 68internal Builder(ImmutableDictionary<TKey, TValue> map) 97ImmutableDictionary<TKey, TValue>.MutationResult result = ImmutableDictionary<TKey, TValue>.AddRange(this, input); 422ImmutableDictionary<TKey, TValue>.MutationResult result = ImmutableDictionary<TKey, TValue>.Add(key, value, KeyCollisionBehavior.SetValue, this.Origin); 435ImmutableDictionary<TKey, TValue>.MutationResult result = ImmutableDictionary<TKey, TValue>.AddRange(items, this.Origin); 503public ImmutableDictionary<TKey, TValue> ToImmutable() 508return _immutable ??= ImmutableDictionary<TKey, TValue>.Wrap(_root, _comparers, _count); 525ImmutableDictionary<TKey, TValue>.MutationResult result = ImmutableDictionary<TKey, TValue>.Add(key, value, KeyCollisionBehavior.ThrowIfValueDifferent, this.Origin); 539return ImmutableDictionary<TKey, TValue>.ContainsKey(key, this.Origin); 543/// Determines whether the <see cref="ImmutableDictionary{TKey, TValue}"/> 547/// The value to locate in the <see cref="ImmutableDictionary{TKey, TValue}"/>. 551/// true if the <see cref="ImmutableDictionary{TKey, TValue}"/> contains 578ImmutableDictionary<TKey, TValue>.MutationResult result = ImmutableDictionary<TKey, TValue>.Remove(key, this.Origin); 593return ImmutableDictionary<TKey, TValue>.TryGetValue(key, this.Origin, out value!); 601return ImmutableDictionary<TKey, TValue>.TryGetKey(equalKey, this.Origin, out actualKey); 633return ImmutableDictionary<TKey, TValue>.Contains(item, this.Origin); 721private readonly ImmutableDictionary<TKey, TValue>.Builder _map; 732public ImmutableDictionaryBuilderDebuggerProxy(ImmutableDictionary<TKey, TValue>.Builder map)
System\Collections\Immutable\ImmutableDictionary_2.Comparers.cs (1)
9/// Contains the inner <see cref="ImmutableDictionary{TKey, TValue}.Comparers"/> class.
System\Collections\Immutable\ImmutableDictionary_2.cs (40)
23public static readonly ImmutableDictionary<TKey, TValue> Empty = new ImmutableDictionary<TKey, TValue>(); 46/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}"/> class. 62/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}"/> class. 123public ImmutableDictionary<TKey, TValue> Clear() 170foreach (KeyValuePair<int, ImmutableDictionary<TKey, TValue>.HashBucket> bucket in _root) 187foreach (KeyValuePair<int, ImmutableDictionary<TKey, TValue>.HashBucket> bucket in _root) 298public ImmutableDictionary<TKey, TValue> Add(TKey key, TValue value) 302ImmutableDictionary<TKey, TValue>.MutationResult result = Add(key, value, KeyCollisionBehavior.ThrowIfValueDifferent, this.Origin); 309public ImmutableDictionary<TKey, TValue> AddRange(IEnumerable<KeyValuePair<TKey, TValue>> pairs) 319public ImmutableDictionary<TKey, TValue> SetItem(TKey key, TValue value) 323ImmutableDictionary<TKey, TValue>.MutationResult result = Add(key, value, KeyCollisionBehavior.SetValue, this.Origin); 332public ImmutableDictionary<TKey, TValue> SetItems(IEnumerable<KeyValuePair<TKey, TValue>> items) 336ImmutableDictionary<TKey, TValue>.MutationResult result = AddRange(items, this.Origin, KeyCollisionBehavior.SetValue); 343public ImmutableDictionary<TKey, TValue> Remove(TKey key) 347ImmutableDictionary<TKey, TValue>.MutationResult result = Remove(key, this.Origin); 354public ImmutableDictionary<TKey, TValue> RemoveRange(IEnumerable<TKey> keys) 359SortedInt32KeyNode<ImmutableDictionary<TKey, TValue>.HashBucket> root = _root; 367ImmutableDictionary<TKey, TValue>.HashBucket newBucket = bucket.Remove(key, _comparers.KeyOnlyComparer, out result); 425public ImmutableDictionary<TKey, TValue> WithComparers(IEqualityComparer<TKey>? keyComparer, IEqualityComparer<TValue>? valueComparer) 441ImmutableDictionary<TKey, TValue>.Comparers comparers = _comparers.WithValueComparer(valueComparer); 448var set = new ImmutableDictionary<TKey, TValue>(comparers); 457public ImmutableDictionary<TKey, TValue> WithComparers(IEqualityComparer<TKey>? keyComparer) 463/// Determines whether the <see cref="ImmutableDictionary{TKey, TValue}"/> 467/// The value to locate in the <see cref="ImmutableDictionary{TKey, TValue}"/>. 471/// true if the <see cref="ImmutableDictionary{TKey, TValue}"/> contains 828private static ImmutableDictionary<TKey, TValue> EmptyWithComparers(Comparers comparers) 838/// Attempts to discover an <see cref="ImmutableDictionary{TKey, TValue}"/> instance beneath some enumerable sequence 842/// <param name="other">Receives the concrete <see cref="ImmutableDictionary{TKey, TValue}"/> typed value if one can be found.</param> 844private static bool TryCastToImmutableMap(IEnumerable<KeyValuePair<TKey, TValue>> sequence, [NotNullWhen(true)] out ImmutableDictionary<TKey, TValue>? other) 846other = sequence as ImmutableDictionary<TKey, TValue>; 937ImmutableDictionary<TKey, TValue>.HashBucket newBucket = bucket.Add(key, value, origin.KeyOnlyComparer, origin.ValueComparer, behavior, out result); 943SortedInt32KeyNode<ImmutableDictionary<TKey, TValue>.HashBucket> newRoot = UpdateRoot(origin.Root, hashCode, newBucket, origin.HashBucketComparer); 955SortedInt32KeyNode<ImmutableDictionary<TKey, TValue>.HashBucket> newRoot = origin.Root; 962ImmutableDictionary<TKey, TValue>.HashBucket newBucket = bucket.Add(pair.Key, pair.Value, origin.KeyOnlyComparer, origin.ValueComparer, collisionBehavior, out result); 983SortedInt32KeyNode<ImmutableDictionary<TKey, TValue>.HashBucket> newRoot = UpdateRoot(origin.Root, hashCode, bucket.Remove(key, origin.KeyOnlyComparer, out result), origin.HashBucketComparer); 1016private static ImmutableDictionary<TKey, TValue> Wrap(SortedInt32KeyNode<HashBucket> root, Comparers comparers, int count) 1030private ImmutableDictionary<TKey, TValue> Wrap(SortedInt32KeyNode<HashBucket>? root, int adjustedCountIfDifferentRoot) 1050private ImmutableDictionary<TKey, TValue> AddRange(IEnumerable<KeyValuePair<TKey, TValue>> pairs, bool avoidToHashMap) 1059if (TryCastToImmutableMap(pairs, out ImmutableDictionary<TKey, TValue>? other)) 1065ImmutableDictionary<TKey, TValue>.MutationResult result = AddRange(pairs, this.Origin);
System\Collections\Immutable\ImmutableDictionary_2.Enumerator.cs (2)
9/// Contains the inner <see cref="ImmutableDictionary{TKey, TValue}.Enumerator"/> struct. 39/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}.Enumerator"/> struct.
System\Collections\Immutable\ImmutableDictionary_2.HashBucket.cs (3)
11/// Contains the inner <see cref="ImmutableDictionary{TKey, TValue}.HashBucket"/> struct. 37/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}.HashBucket"/> struct. 354/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}.HashBucket.Enumerator"/> struct.
System\Collections\Immutable\ImmutableDictionary_2.MutationInput.cs (4)
9/// Contains the inner <see cref="ImmutableDictionary{TKey, TValue}.MutationInput"/> class. 30/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}.MutationInput"/> struct. 44/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}.MutationInput"/> struct. 47internal MutationInput(ImmutableDictionary<TKey, TValue> map)
System\Collections\Immutable\ImmutableDictionary_2.MutationResult.cs (5)
7/// Contains the inner <see cref="ImmutableDictionary{TKey, TValue}.MutationResult"/> class. 27/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}.MutationResult"/> struct. 37/// Initializes a new instance of the <see cref="ImmutableDictionary{TKey, TValue}.MutationResult"/> struct. 69internal ImmutableDictionary<TKey, TValue> Finalize(ImmutableDictionary<TKey, TValue> priorMap)
System\Collections\Immutable\ImmutableInterlocked.cs (28)
244public static TValue GetOrAdd<TKey, TValue, TArg>(ref ImmutableDictionary<TKey, TValue> location, TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument) where TKey : notnull 248ImmutableDictionary<TKey, TValue> map = Volatile.Read(ref location); 273public static TValue GetOrAdd<TKey, TValue>(ref ImmutableDictionary<TKey, TValue> location, TKey key, Func<TKey, TValue> valueFactory) where TKey : notnull 277ImmutableDictionary<TKey, TValue> map = Volatile.Read(ref location); 299public static TValue GetOrAdd<TKey, TValue>(ref ImmutableDictionary<TKey, TValue> location, TKey key, TValue value) where TKey : notnull 301ImmutableDictionary<TKey, TValue> priorCollection = Volatile.Read(ref location); 312ImmutableDictionary<TKey, TValue> updatedCollection = priorCollection.Add(key, value); 313ImmutableDictionary<TKey, TValue> interlockedResult = Interlocked.CompareExchange(ref location, updatedCollection, priorCollection); 334public static TValue AddOrUpdate<TKey, TValue>(ref ImmutableDictionary<TKey, TValue> location, TKey key, Func<TKey, TValue> addValueFactory, Func<TKey, TValue, TValue> updateValueFactory) where TKey : notnull 340ImmutableDictionary<TKey, TValue> priorCollection = Volatile.Read(ref location); 356ImmutableDictionary<TKey, TValue> updatedCollection = priorCollection.SetItem(key, newValue); 361ImmutableDictionary<TKey, TValue> interlockedResult = Interlocked.CompareExchange(ref location, updatedCollection, priorCollection); 382public static TValue AddOrUpdate<TKey, TValue>(ref ImmutableDictionary<TKey, TValue> location, TKey key, TValue addValue, Func<TKey, TValue, TValue> updateValueFactory) where TKey : notnull 387ImmutableDictionary<TKey, TValue> priorCollection = Volatile.Read(ref location); 403ImmutableDictionary<TKey, TValue> updatedCollection = priorCollection.SetItem(key, newValue); 408ImmutableDictionary<TKey, TValue> interlockedResult = Interlocked.CompareExchange(ref location, updatedCollection, priorCollection); 428public static bool TryAdd<TKey, TValue>(ref ImmutableDictionary<TKey, TValue> location, TKey key, TValue value) where TKey : notnull 430ImmutableDictionary<TKey, TValue> priorCollection = Volatile.Read(ref location); 441ImmutableDictionary<TKey, TValue> updatedCollection = priorCollection.Add(key, value); 442ImmutableDictionary<TKey, TValue> interlockedResult = Interlocked.CompareExchange(ref location, updatedCollection, priorCollection); 460public static bool TryUpdate<TKey, TValue>(ref ImmutableDictionary<TKey, TValue> location, TKey key, TValue newValue, TValue comparisonValue) where TKey : notnull 463ImmutableDictionary<TKey, TValue> priorCollection = Volatile.Read(ref location); 476ImmutableDictionary<TKey, TValue> updatedCollection = priorCollection.SetItem(key, newValue); 477ImmutableDictionary<TKey, TValue> interlockedResult = Interlocked.CompareExchange(ref location, updatedCollection, priorCollection); 494public static bool TryRemove<TKey, TValue>(ref ImmutableDictionary<TKey, TValue> location, TKey key, [MaybeNullWhen(false)] out TValue value) where TKey : notnull 496ImmutableDictionary<TKey, TValue> priorCollection = Volatile.Read(ref location); 507ImmutableDictionary<TKey, TValue> updatedCollection = priorCollection.Remove(key); 508ImmutableDictionary<TKey, TValue> interlockedResult = Interlocked.CompareExchange(ref location, updatedCollection, priorCollection);
System.Text.Json.SourceGeneration (1)
Helpers\KnownTypeSymbols.cs (1)
112public INamedTypeSymbol? ImmutableDictionaryType => GetOrResolveType(typeof(ImmutableDictionary<,>), ref _ImmutableDictionaryType);