2 types derived from Lazy
System.ComponentModel.Composition (1)
System.Private.CoreLib (1)
863 instantiations of Lazy
aspire (1)
Aspire.Azure.Data.Tables.Tests (1)
Aspire.Azure.Messaging.ServiceBus.Tests (2)
Aspire.Azure.Security.KeyVault.Tests (3)
Aspire.Azure.Storage.Blobs.Tests (1)
Aspire.Azure.Storage.Files.DataLake.Tests (1)
Aspire.Azure.Storage.Queues.Tests (1)
Aspire.Confluent.Kafka.Tests (5)
Aspire.Dashboard (5)
Aspire.Dashboard.Components.Tests (2)
Aspire.EndToEnd.Tests (5)
Aspire.Hosting (10)
Aspire.Hosting.Azure (7)
Aspire.Hosting.JavaScript (1)
Aspire.Hosting.RemoteHost.Tests (4)
Aspire.Hosting.Testing.Tests (1)
Aspire.Hosting.Tests (1)
Aspire.StackExchange.Redis (1)
Aspire.Templates.Tests (6)
Aspire.TestUtilities (2)
aspire-server (5)
dotnet-svcutil-lib (2)
GenerateDocumentationAndConfigFiles (6)
ILLink.RoslynAnalyzer (2)
Infrastructure.Common (1)
Metrics (6)
Metrics.Legacy (6)
Microsoft.AspNetCore.App.Analyzers.Test (1)
Microsoft.AspNetCore.DataProtection (3)
Microsoft.AspNetCore.DataProtection.Tests (3)
Microsoft.AspNetCore.Grpc.JsonTranscoding (2)
Microsoft.AspNetCore.Http.Extensions (2)
Microsoft.AspNetCore.HttpsPolicy (2)
Microsoft.AspNetCore.InternalTesting (1)
Microsoft.AspNetCore.Mvc.Abstractions (2)
Microsoft.AspNetCore.Mvc.Core (1)
Microsoft.AspNetCore.OpenApi (2)
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Microsoft.AspNetCore.SignalR.Core (2)
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (1)
Microsoft.AspNetCore.WebSockets.ConformanceTests (1)
Microsoft.Build (38)
FileMatcher.cs (4)
52private static readonly Lazy<ConcurrentDictionary<string, IReadOnlyList<string>>> s_cachedGlobExpansions = new Lazy<ConcurrentDictionary<string, IReadOnlyList<string>>>(() => new ConcurrentDictionary<string, IReadOnlyList<string>>(StringComparer.OrdinalIgnoreCase));
53private static readonly Lazy<ConcurrentDictionary<string, object>> s_cachedGlobExpansionsLock = new Lazy<ConcurrentDictionary<string, object>>(() => new ConcurrentDictionary<string, object>(StringComparer.OrdinalIgnoreCase));
54private static readonly Lazy<ConcurrentDictionary<string, (Regex regex, bool needsRecursion, bool isLegalFileSpec)>> s_regexCache = new(() =>new(StringComparer.Ordinal));
57private readonly Lazy<ConcurrentDictionary<string, object>> _cachedGlobExpansionsLock = new Lazy<ConcurrentDictionary<string, object>>(() => new ConcurrentDictionary<string, object>(StringComparer.OrdinalIgnoreCase));
Microsoft.Build.Engine.OM.UnitTests (5)
Microsoft.Build.Engine.UnitTests (1)
Microsoft.Build.Framework (5)
Microsoft.Build.Tasks.Core (34)
FileMatcher.cs (4)
52private static readonly Lazy<ConcurrentDictionary<string, IReadOnlyList<string>>> s_cachedGlobExpansions = new Lazy<ConcurrentDictionary<string, IReadOnlyList<string>>>(() => new ConcurrentDictionary<string, IReadOnlyList<string>>(StringComparer.OrdinalIgnoreCase));
53private static readonly Lazy<ConcurrentDictionary<string, object>> s_cachedGlobExpansionsLock = new Lazy<ConcurrentDictionary<string, object>>(() => new ConcurrentDictionary<string, object>(StringComparer.OrdinalIgnoreCase));
54private static readonly Lazy<ConcurrentDictionary<string, (Regex regex, bool needsRecursion, bool isLegalFileSpec)>> s_regexCache = new(() =>new(StringComparer.Ordinal));
57private readonly Lazy<ConcurrentDictionary<string, object>> _cachedGlobExpansionsLock = new Lazy<ConcurrentDictionary<string, object>>(() => new ConcurrentDictionary<string, object>(StringComparer.OrdinalIgnoreCase));
Microsoft.Build.UnitTests.Shared (2)
Microsoft.Build.Utilities.Core (12)
FileMatcher.cs (4)
52private static readonly Lazy<ConcurrentDictionary<string, IReadOnlyList<string>>> s_cachedGlobExpansions = new Lazy<ConcurrentDictionary<string, IReadOnlyList<string>>>(() => new ConcurrentDictionary<string, IReadOnlyList<string>>(StringComparer.OrdinalIgnoreCase));
53private static readonly Lazy<ConcurrentDictionary<string, object>> s_cachedGlobExpansionsLock = new Lazy<ConcurrentDictionary<string, object>>(() => new ConcurrentDictionary<string, object>(StringComparer.OrdinalIgnoreCase));
54private static readonly Lazy<ConcurrentDictionary<string, (Regex regex, bool needsRecursion, bool isLegalFileSpec)>> s_regexCache = new(() =>new(StringComparer.Ordinal));
57private readonly Lazy<ConcurrentDictionary<string, object>> _cachedGlobExpansionsLock = new Lazy<ConcurrentDictionary<string, object>>(() => new ConcurrentDictionary<string, object>(StringComparer.OrdinalIgnoreCase));
Microsoft.CodeAnalysis (15)
Microsoft.CodeAnalysis.Analyzers (7)
Microsoft.CodeAnalysis.AnalyzerUtilities (13)
Microsoft.CodeAnalysis.BannedApiAnalyzers (7)
Microsoft.CodeAnalysis.CodeStyle (4)
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.CSharp (4)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Microsoft.CodeAnalysis.EditorFeatures (5)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (1)
Microsoft.CodeAnalysis.Features (20)
Microsoft.CodeAnalysis.LanguageServer (5)
Microsoft.CodeAnalysis.LanguageServer.Protocol (8)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (6)
Microsoft.CodeAnalysis.PublicApiAnalyzers (7)
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Microsoft.CodeAnalysis.ResxSourceGenerator (6)
Microsoft.CodeAnalysis.SemanticSearch.Extensions (2)
Microsoft.CodeAnalysis.Test.Utilities (180)
Microsoft.CodeAnalysis.UnitTests (2)
Microsoft.CodeAnalysis.Workspaces (21)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (3)
Microsoft.CommonLanguageServerProtocol.Framework.Package (6)
Microsoft.DotNet.Deployment.Tasks.Links (2)
Microsoft.DotNet.Helix.Sdk (1)
Microsoft.DotNet.XUnitExtensions (13)
Microsoft.DotNet.XUnitV3Extensions (13)
Microsoft.Extensions.DataIngestion.Tests (1)
Microsoft.Extensions.DependencyInjection.Abstractions (1)
Microsoft.Extensions.DependencyModel (1)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
Microsoft.Extensions.Http (2)
Microsoft.Extensions.Options (3)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (1)
Microsoft.Extensions.Telemetry (2)
Microsoft.Interop.LibraryImportGenerator (4)
Microsoft.Maui (3)
Microsoft.Maui.Controls (47)
Microsoft.Maui.Controls.DesignTools (2)
Microsoft.Maui.Controls.Foldable (3)
Microsoft.Maui.Resizetizer (1)
Microsoft.ML.AutoML (2)
Microsoft.ML.CodeAnalyzer.Tests (1)
Microsoft.ML.Data (2)
Microsoft.ML.FastTree (3)
Microsoft.VisualStudio.LanguageServices (10)
Microsoft.VisualStudio.LanguageServices.CSharp (4)
Microsoft.VisualStudio.LanguageServices.Implementation (1)
MinimalValidationSample (1)
MSBuild (11)
PresentationFramework (27)
Roslyn.Diagnostics.Analyzers (6)
Roslyn.Test.PdbUtilities (1)
Shared (2)
Sockets.BindTests (2)
Sockets.FunctionalTests (2)
System.ComponentModel.Annotations (1)
System.ComponentModel.Composition (14)
System.ComponentModel.TypeConverter (2)
System.Composition.Hosting (3)
System.Composition.TypedParts (1)
System.Console (1)
System.Drawing.Primitives (1)
System.Formats.Tar (1)
System.Net.Http (1)
System.Net.Ping (3)
System.Net.Quic (1)
System.Net.Security (3)
System.Private.Windows.Core.TestUtilities (2)
System.Private.Xml (1)
System.Reflection.Metadata (1)
System.Security.Cryptography (28)
System.ServiceModel.Http (1)
System.ServiceModel.Primitives (1)
System.Threading.RateLimiting (1)
System.Windows.Forms.Primitives.TestUtilities (1)
System.Xaml (56)
System\Xaml\XamlLanguage.cs (55)
56new Lazy<XamlSchemaContext>(GetSchemaContext);
59new Lazy<XamlType>(() => GetXamlType(typeof(ArrayExtension)));
61new Lazy<XamlType>(() => GetXamlType(typeof(NullExtension)));
63new Lazy<XamlType>(() => GetXamlType(typeof(Reference)));
65new Lazy<XamlType>(() => GetXamlType(typeof(StaticExtension)));
67new Lazy<XamlType>(() => GetXamlType(typeof(TypeExtension)));
69new Lazy<XamlType>(() => GetXamlType(typeof(string)));
71new Lazy<XamlType>(() => GetXamlType(typeof(double)));
73new Lazy<XamlType>(() => GetXamlType(typeof(int)));
75new Lazy<XamlType>(() => GetXamlType(typeof(bool)));
77new Lazy<XamlType>(() => GetXamlType(typeof(MemberDefinition)));
79new Lazy<XamlType>(() => GetXamlType(typeof(PropertyDefinition)));
81new Lazy<XamlType>(() => GetXamlType(typeof(XData)));
84new Lazy<XamlType>(() => GetXamlType(typeof(object)));
86new Lazy<XamlType>(() => GetXamlType(typeof(List<object>)));
88new Lazy<XamlType>(() => GetXamlType(typeof(List<MemberDefinition>)));
90new Lazy<XamlType>(() => GetXamlType(typeof(List<Attribute>)));
93new Lazy<XamlType>(() => GetXamlType(typeof(MarkupExtension)));
95new Lazy<XamlType>(() => GetXamlType(typeof(INameScope)));
97new Lazy<XamlType>(() => GetXamlType(typeof(IXmlSerializable)), true);
100new Lazy<XamlType>(() => GetXamlType(typeof(PositionalParameterDescriptor)), true);
103new Lazy<XamlType>(() => GetXamlType(typeof(char)), true);
105new Lazy<XamlType>(() => GetXamlType(typeof(float)), true);
107new Lazy<XamlType>(() => GetXamlType(typeof(byte)), true);
109new Lazy<XamlType>(() => GetXamlType(typeof(short)), true);
111new Lazy<XamlType>(() => GetXamlType(typeof(long)), true);
113new Lazy<XamlType>(() => GetXamlType(typeof(decimal)), true);
115new Lazy<XamlType>(() => GetXamlType(typeof(Uri)), true);
117new Lazy<XamlType>(() => GetXamlType(typeof(TimeSpan)), true);
120new Lazy<ReadOnlyCollection<XamlType>>(GetAllTypes);
123new Lazy<XamlDirective>(() => GetXamlDirective(x_AsyncRecords,
126new Lazy<XamlDirective>(() => GetXamlDirective(x_Arguments,
129new Lazy<XamlDirective>(() => GetXamlDirective(x_Class));
131new Lazy<XamlDirective>(() => GetXamlDirective(x_ClassModifier));
133new Lazy<XamlDirective>(() => GetXamlDirective(x_Code));
135new Lazy<XamlDirective>(() => GetXamlDirective(x_ConnectionId,
138new Lazy<XamlDirective>(() => GetXamlDirective(x_FactoryMethod,
141new Lazy<XamlDirective>(() => GetXamlDirective(x_FieldModifier));
143new Lazy<XamlDirective>(() => GetXamlDirective(x_Items,
146new Lazy<XamlDirective>(() => GetXamlDirective(x_Initialization,
149new Lazy<XamlDirective>(() => GetXamlDirective(x_Key,
152new Lazy<XamlDirective>(() => GetXamlDirective(x_Members,
155new Lazy<XamlDirective>(() => GetXamlDirective(x_ClassAttributes,
158new Lazy<XamlDirective>(() => GetXamlDirective(x_Name));
160new Lazy<XamlDirective>(() => GetXamlDirective(x_PositionalParameters,
163new Lazy<XamlDirective>(() => GetXamlDirective(x_Shared), true);
165new Lazy<XamlDirective>(() => GetXamlDirective(x_Subclass), true);
167new Lazy<XamlDirective>(() => GetXamlDirective(x_SynchronousMode));
169new Lazy<XamlDirective>(() => GetXamlDirective(x_TypeArguments));
171new Lazy<XamlDirective>(() => GetXamlDirective(x_Uid));
173new Lazy<XamlDirective>(() => GetXamlDirective(x_UnknownContent, AllowedMemberLocations.MemberElement, MemberReflector.UnknownReflector), true);
176new Lazy<XamlDirective>(() => GetXmlDirective(xml_Base));
178new Lazy<XamlDirective>(() => GetXmlDirective(xml_Lang));
180new Lazy<XamlDirective>(() => GetXmlDirective(xml_Space));
183new Lazy<ReadOnlyCollection<XamlDirective>>(GetAllDirectives);
Test.Utilities (6)
Text.Analyzers (6)
xunit.assert (4)
xunit.console (4)
1339 references to Lazy
aspire (2)
Aspire.Azure.Data.Tables.Tests (1)
Aspire.Azure.Messaging.ServiceBus.Tests (2)
Aspire.Azure.Security.KeyVault.Tests (3)
Aspire.Azure.Storage.Blobs.Tests (1)
Aspire.Azure.Storage.Files.DataLake.Tests (1)
Aspire.Azure.Storage.Queues.Tests (1)
Aspire.Confluent.Kafka.Tests (5)
Aspire.Dashboard (6)
Aspire.Dashboard.Components.Tests (2)
Aspire.EndToEnd.Tests (5)
Aspire.Hosting (10)
Aspire.Hosting.Azure (5)
Aspire.Hosting.JavaScript (1)
Aspire.Hosting.Testing.Tests (1)
Aspire.Hosting.Tests (1)
Aspire.StackExchange.Redis (1)
Aspire.Templates.Tests (6)
Aspire.TestUtilities (2)
aspire-server (6)
dotnet-svcutil-lib (2)
GenerateDocumentationAndConfigFiles (16)
ILLink.RoslynAnalyzer (2)
Infrastructure.Common (1)
Metrics (15)
Metrics.Legacy (15)
Microsoft.AspNetCore.App.Analyzers.Test (2)
Microsoft.AspNetCore.DataProtection (3)
Microsoft.AspNetCore.DataProtection.Tests (3)
Microsoft.AspNetCore.Grpc.JsonTranscoding (2)
Microsoft.AspNetCore.Http.Extensions (2)
Microsoft.AspNetCore.HttpsPolicy (1)
Microsoft.AspNetCore.InternalTesting (1)
Microsoft.AspNetCore.Mvc.Abstractions (2)
Microsoft.AspNetCore.Mvc.Core (3)
Microsoft.AspNetCore.OpenApi (2)
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Microsoft.AspNetCore.SignalR.Core (2)
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (1)
Microsoft.AspNetCore.WebSockets.ConformanceTests (1)
Microsoft.Build (58)
FileMatcher.cs (4)
52private static readonly Lazy<ConcurrentDictionary<string, IReadOnlyList<string>>> s_cachedGlobExpansions = new Lazy<ConcurrentDictionary<string, IReadOnlyList<string>>>(() => new ConcurrentDictionary<string, IReadOnlyList<string>>(StringComparer.OrdinalIgnoreCase));
53private static readonly Lazy<ConcurrentDictionary<string, object>> s_cachedGlobExpansionsLock = new Lazy<ConcurrentDictionary<string, object>>(() => new ConcurrentDictionary<string, object>(StringComparer.OrdinalIgnoreCase));
54private static readonly Lazy<ConcurrentDictionary<string, (Regex regex, bool needsRecursion, bool isLegalFileSpec)>> s_regexCache = new(() =>new(StringComparer.Ordinal));
57private readonly Lazy<ConcurrentDictionary<string, object>> _cachedGlobExpansionsLock = new Lazy<ConcurrentDictionary<string, object>>(() => new ConcurrentDictionary<string, object>(StringComparer.OrdinalIgnoreCase));
Microsoft.Build.Engine.OM.UnitTests (7)
Microsoft.Build.Engine.UnitTests (2)
Microsoft.Build.Framework (8)
Microsoft.Build.Tasks.Core (33)
FileMatcher.cs (4)
52private static readonly Lazy<ConcurrentDictionary<string, IReadOnlyList<string>>> s_cachedGlobExpansions = new Lazy<ConcurrentDictionary<string, IReadOnlyList<string>>>(() => new ConcurrentDictionary<string, IReadOnlyList<string>>(StringComparer.OrdinalIgnoreCase));
53private static readonly Lazy<ConcurrentDictionary<string, object>> s_cachedGlobExpansionsLock = new Lazy<ConcurrentDictionary<string, object>>(() => new ConcurrentDictionary<string, object>(StringComparer.OrdinalIgnoreCase));
54private static readonly Lazy<ConcurrentDictionary<string, (Regex regex, bool needsRecursion, bool isLegalFileSpec)>> s_regexCache = new(() =>new(StringComparer.Ordinal));
57private readonly Lazy<ConcurrentDictionary<string, object>> _cachedGlobExpansionsLock = new Lazy<ConcurrentDictionary<string, object>>(() => new ConcurrentDictionary<string, object>(StringComparer.OrdinalIgnoreCase));
Microsoft.Build.Tasks.UnitTests (1)
Microsoft.Build.UnitTests.Shared (2)
Microsoft.Build.Utilities.Core (12)
FileMatcher.cs (4)
52private static readonly Lazy<ConcurrentDictionary<string, IReadOnlyList<string>>> s_cachedGlobExpansions = new Lazy<ConcurrentDictionary<string, IReadOnlyList<string>>>(() => new ConcurrentDictionary<string, IReadOnlyList<string>>(StringComparer.OrdinalIgnoreCase));
53private static readonly Lazy<ConcurrentDictionary<string, object>> s_cachedGlobExpansionsLock = new Lazy<ConcurrentDictionary<string, object>>(() => new ConcurrentDictionary<string, object>(StringComparer.OrdinalIgnoreCase));
54private static readonly Lazy<ConcurrentDictionary<string, (Regex regex, bool needsRecursion, bool isLegalFileSpec)>> s_regexCache = new(() =>new(StringComparer.Ordinal));
57private readonly Lazy<ConcurrentDictionary<string, object>> _cachedGlobExpansionsLock = new Lazy<ConcurrentDictionary<string, object>>(() => new ConcurrentDictionary<string, object>(StringComparer.OrdinalIgnoreCase));
Microsoft.CodeAnalysis (26)
Microsoft.CodeAnalysis.Analyzers (17)
Microsoft.CodeAnalysis.AnalyzerUtilities (35)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataConfig.cs (16)
58private ImmutableDictionary<SinkKind, Lazy<TaintedDataSymbolMap<SourceInfo>>> SourceSymbolMap { get; }
63private ImmutableDictionary<SinkKind, Lazy<TaintedDataSymbolMap<SanitizerInfo>>> SanitizerSymbolMap { get; }
68private ImmutableDictionary<SinkKind, Lazy<TaintedDataSymbolMap<SinkInfo>>> SinkSymbolMap { get; }
82ImmutableDictionary<SinkKind, Lazy<TaintedDataSymbolMap<SourceInfo>>> sourceSymbolMap,
83ImmutableDictionary<SinkKind, Lazy<TaintedDataSymbolMap<SanitizerInfo>>> sanitizerSymbolMap,
84ImmutableDictionary<SinkKind, Lazy<TaintedDataSymbolMap<SinkInfo>>> sinkSymbolMap)
96PooledDictionary<SinkKind, Lazy<TaintedDataSymbolMap<SourceInfo>>>.GetInstance(out var sourceSymbolMapBuilder);
98PooledDictionary<SinkKind, Lazy<TaintedDataSymbolMap<SanitizerInfo>>>.GetInstance(out var sanitizerSymbolMapBuilder);
100PooledDictionary<SinkKind, Lazy<TaintedDataSymbolMap<SinkInfo>>>.GetInstance(out var sinkSymbolMapBuilder);
105PooledDictionary<ImmutableHashSet<SourceInfo>, Lazy<TaintedDataSymbolMap<SourceInfo>>>.GetInstance(out var sourcesToSymbolMap);
107PooledDictionary<ImmutableHashSet<SanitizerInfo>, Lazy<TaintedDataSymbolMap<SanitizerInfo>>>.GetInstance(out var sanitizersToSymbolMap);
117if (!sourcesToSymbolMap.TryGetValue(sources, out Lazy<TaintedDataSymbolMap<SourceInfo>> lazySourceSymbolMap))
128if (!sanitizersToSymbolMap.TryGetValue(sanitizers, out Lazy<TaintedDataSymbolMap<SanitizerInfo>> lazySanitizerSymbolMap))
152Lazy<TaintedDataSymbolMap<SinkInfo>> lazySinkSymbolMap = new Lazy<TaintedDataSymbolMap<SinkInfo>>(
191private TaintedDataSymbolMap<T> GetFromMap<T>(SinkKind sinkKind, ImmutableDictionary<SinkKind, Lazy<TaintedDataSymbolMap<T>>> map)
194if (map.TryGetValue(sinkKind, out var lazySourceSymbolMap))
Microsoft.CodeAnalysis.BannedApiAnalyzers (17)
Microsoft.CodeAnalysis.CodeStyle (7)
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
Microsoft.CodeAnalysis.CSharp (28)
Compilation\SyntaxAndDeclarationManager.cs (9)
60var declMapBuilder = PooledDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>>.GetInstance();
163IDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>> declMapBuilder,
198IDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>> declMapBuilder,
295IDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>> declMapBuilder,
299var lazyRoot = new Lazy<RootSingleNamespaceDeclaration>(() => DeclarationTreeBuilder.ForTree(tree, scriptClassName, isSubmission, lastComputedMemberNames));
458IDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>> declMap,
461var lazyRoot = declMap[tree];
607ImmutableDictionary<SyntaxTree, Lazy<RootSingleNamespaceDeclaration>>.Builder declMapBuilder,
610var previousRootNamespaceDeclaration = declMapBuilder[oldTree];
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Features (4)
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (7)
DeclarationTests.cs (7)
195private Lazy<RootSingleNamespaceDeclaration> Lazy(RootSingleNamespaceDeclaration decl)
234var decl1 = Lazy(DeclarationTreeBuilder.ForTree(tree1, TestOptions.DebugExe.ScriptClassName, isSubmission: false));
235var decl2 = Lazy(DeclarationTreeBuilder.ForTree(tree2, TestOptions.DebugExe.ScriptClassName, isSubmission: false));
304var decl1 = Lazy(DeclarationTreeBuilder.ForTree(tree1, TestOptions.DebugExe.ScriptClassName, isSubmission: false));
305var decl2 = Lazy(DeclarationTreeBuilder.ForTree(tree2, TestOptions.DebugExe.ScriptClassName, isSubmission: false));
355var decl1 = Lazy(DeclarationTreeBuilder.ForTree(tree1, TestOptions.DebugExe.ScriptClassName, isSubmission: false));
356var decl2 = Lazy(DeclarationTreeBuilder.ForTree(tree2, TestOptions.DebugExe.ScriptClassName, isSubmission: false));
Microsoft.CodeAnalysis.EditorFeatures (32)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (1)
Microsoft.CodeAnalysis.Extensions.Package (1)
Microsoft.CodeAnalysis.ExternalAccess.Debugger (2)
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (8)
Microsoft.CodeAnalysis.Features (51)
CodeFixes\Service\CodeFixService.cs (24)
43private readonly Lazy<ImmutableDictionary<string, ImmutableArray<Lazy<CodeFixProvider, CodeChangeProviderMetadata>>>> _fixersPerLanguageMap;
48private readonly Lazy<ImmutableDictionary<LanguageKind, Lazy<ImmutableArray<IConfigurationFixProvider>>>> _configurationProvidersMap;
49private readonly ImmutableArray<Lazy<IErrorLoggerService>> _errorLoggers;
51private ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>>>? _lazyWorkspaceFixersMap;
52private ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<CodeFixProvider, int>>>? _lazyFixerPriorityMap;
61[ImportMany] IEnumerable<Lazy<IErrorLoggerService>> loggers,
367if (!_lazyWorkspaceFixersMap.TryGetValue(document.Project.Language, out var lazyFixerMap))
382private bool TryGetWorkspaceFixersPriorityMap(TextDocument document, [NotNullWhen(true)] out Lazy<ImmutableDictionary<CodeFixProvider, int>>? fixersPriorityMap)
424foreach (var errorLogger in _errorLoggers)
494if (TryGetWorkspaceFixersPriorityMap(document, out var fixersForLanguage))
745if (!_configurationProvidersMap.Value.TryGetValue(document.Project.Language, out var lazyConfigurationProviders) ||
839if (!_configurationProvidersMap.Value.TryGetValue(language, out var lazyConfigurationProviders) ||
880foreach (var logger in _errorLoggers)
903private ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>>> GetFixerPerLanguageMap(
906var fixerMap = ImmutableDictionary.Create<LanguageKind, Lazy<ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>>>();
910var lazyMap = new Lazy<ImmutableDictionary<DiagnosticId, ImmutableArray<CodeFixProvider>>>(() =>
941private static ImmutableDictionary<LanguageKind, Lazy<ImmutableArray<IConfigurationFixProvider>>> GetConfigurationProvidersPerLanguageMap(
946var configurationFixerMap = ImmutableDictionary.CreateBuilder<LanguageKind, Lazy<ImmutableArray<IConfigurationFixProvider>>>();
949var lazyConfigurationFixers = new Lazy<ImmutableArray<IConfigurationFixProvider>>(() => GetConfigurationFixProviders(lazyFixers));
966private ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<CodeFixProvider, int>>> GetFixerPriorityPerLanguageMap(SolutionServices services)
968var languageMap = ImmutableDictionary.CreateBuilder<LanguageKind, Lazy<ImmutableDictionary<CodeFixProvider, int>>>();
971var lazyMap = new Lazy<ImmutableDictionary<CodeFixProvider, int>>(() =>
1073public ImmutableDictionary<LanguageKind, Lazy<ImmutableDictionary<CodeFixProvider, int>>> GetFixerPriorityPerLanguageMap(SolutionServices services)
Microsoft.CodeAnalysis.LanguageServer (6)
Microsoft.CodeAnalysis.LanguageServer.Protocol (17)
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\RequestExecutionQueue.cs (5)
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)>>>();
103var languages = new Dictionary<string, Lazy<(RequestHandlerMetadata, IMethodHandler, MethodInfo)>>();
419if (handlersForMethod.TryGetValue(language, out var lazyData) ||
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (16)
Microsoft.CodeAnalysis.PublicApiAnalyzers (16)
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Microsoft.CodeAnalysis.Remote.Workspaces (2)
Microsoft.CodeAnalysis.ResxSourceGenerator (15)
Microsoft.CodeAnalysis.SemanticSearch.Extensions (1)
Microsoft.CodeAnalysis.Test.Utilities (180)
Microsoft.CodeAnalysis.UnitTests (1)
Microsoft.CodeAnalysis.Workspaces (32)
Microsoft.CodeAnalysis.Workspaces.Desktop (2)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (4)
Microsoft.CommonLanguageServerProtocol.Framework.Package (15)
RequestExecutionQueue.cs (5)
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)>>>();
103var languages = new Dictionary<string, Lazy<(RequestHandlerMetadata, IMethodHandler, MethodInfo)>>();
419if (handlersForMethod.TryGetValue(language, out var lazyData) ||
Microsoft.DotNet.Deployment.Tasks.Links (1)
Microsoft.DotNet.Helix.Sdk (1)
Microsoft.DotNet.XUnitExtensions (13)
Microsoft.DotNet.XUnitV3Extensions (13)
Microsoft.Extensions.DataIngestion.Tests (1)
Microsoft.Extensions.DependencyInjection.Abstractions (1)
Microsoft.Extensions.DependencyModel (1)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
Microsoft.Extensions.Http (10)
DefaultHttpClientFactory.cs (10)
26private readonly Func<string, Lazy<ActiveHandlerTrackingEntry>> _entryFactory;
27private readonly Lazy<ILogger> _logger;
51internal readonly ConcurrentDictionary<string, Lazy<ActiveHandlerTrackingEntry>> _activeHandlers;
79_activeHandlers = new ConcurrentDictionary<string, Lazy<ActiveHandlerTrackingEntry>>(StringComparer.Ordinal);
199bool removed = _activeHandlers.TryRemove(active.Name, out Lazy<ActiveHandlerTrackingEntry>? found);
347public static void CleanupCycleStart(Lazy<ILogger> loggerLazy, int initialCount)
355public static void CleanupCycleEnd(Lazy<ILogger> loggerLazy, TimeSpan duration, int disposedCount, int finalCount)
363public static void CleanupItemFailed(Lazy<ILogger> loggerLazy, string clientName, Exception exception)
371public static void HandlerExpired(Lazy<ILogger> loggerLazy, string clientName, TimeSpan lifetime)
379private static bool TryGetLogger(Lazy<ILogger> loggerLazy, [NotNullWhen(true)] out ILogger? logger)
Microsoft.Extensions.Options (4)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (1)
Microsoft.Extensions.Telemetry (5)
Microsoft.Interop.LibraryImportGenerator (4)
Microsoft.Maui (4)
Microsoft.Maui.Controls (45)
Microsoft.Maui.Controls.DesignTools (2)
Microsoft.Maui.Controls.Foldable (3)
Microsoft.Maui.Resizetizer (1)
Microsoft.ML.AutoML (2)
Microsoft.ML.CodeAnalyzer.Tests (15)
Microsoft.ML.Data (2)
Microsoft.ML.FastTree (3)
Microsoft.VisualStudio.LanguageServices (41)
Microsoft.VisualStudio.LanguageServices.CodeLens (2)
Microsoft.VisualStudio.LanguageServices.CSharp (5)
Microsoft.VisualStudio.LanguageServices.Implementation (3)
MinimalValidationSample (1)
MSBuild (16)
mscorlib (1)
netstandard (1)
PresentationFramework (27)
Roslyn.Diagnostics.Analyzers (16)
Roslyn.Test.PdbUtilities (1)
Shared (5)
Sockets.BindTests (2)
Sockets.FunctionalTests (2)
System.ComponentModel.Annotations (1)
System.ComponentModel.Composition (91)
System\ComponentModel\Composition\ReflectionModel\GenericSpecializationPartCreationInfo.cs (19)
24private readonly Lazy<Type> _lazyPartType;
26private List<Lazy<ParameterInfo>>? _parameters;
28private Dictionary<Lazy<ParameterInfo>, ParameterInfo>? _parametersTable;
65public Lazy<Type> GetLazyPartType()
117private ParameterInfo GetParameter(Lazy<ParameterInfo> originalParameter)
135List<Lazy<ParameterInfo>>? parameters = null;
154Dictionary<Lazy<ParameterInfo>, ParameterInfo>? parametersTable = BuildParametersTable(parameters);
236private Dictionary<Lazy<ParameterInfo>, ParameterInfo>? BuildParametersTable(List<Lazy<ParameterInfo>>? parameters)
240Dictionary<Lazy<ParameterInfo>, ParameterInfo> parametersTable = new Dictionary<Lazy<ParameterInfo>, ParameterInfo>();
243foreach (var lazyParameter in parameters)
256private List<ImportDefinition> PopulateImports(List<LazyMemberInfo> members, List<Lazy<ParameterInfo>> parameters)
275private ImportDefinition TranslateImport(ReflectionImportDefinition reflectionImport, List<LazyMemberInfo> members, List<Lazy<ParameterInfo>> parameters)
336Lazy<ParameterInfo> lazyParameter = parameterImport.ImportingLazyParameter;
337Lazy<ParameterInfo> parameter = new Lazy<ParameterInfo>(() => GetParameter(lazyParameter));
402Lazy<IDictionary<string, object?>> lazyMetadata = new Lazy<IDictionary<string, object?>>(() => TranslateExportMetadata(capturedReflectionExport));
471List<Lazy<ParameterInfo>> parameters = new List<Lazy<ParameterInfo>>();
System\ComponentModel\Composition\ReflectionModel\ReflectionModelServices.cs (20)
17public static Lazy<Type> GetPartType(ComposablePartDefinition partDefinition)
73public static Lazy<ParameterInfo> GetImportingParameter(ImportDefinition importDefinition)
127Lazy<Type> partType,
129Lazy<IEnumerable<ImportDefinition>>? imports,
130Lazy<IEnumerable<ExportDefinition>>? exports,
131Lazy<IDictionary<string, object?>>? metadata,
149Lazy<IDictionary<string, object?>> metadata,
248Lazy<ParameterInfo> parameter,
260Lazy<ParameterInfo> parameter,
319private readonly Lazy<Type> _partType;
320private readonly Lazy<IEnumerable<ImportDefinition>>? _imports;
321private readonly Lazy<IEnumerable<ExportDefinition>>? _exports;
322private readonly Lazy<IDictionary<string, object?>>? _metadata;
328Lazy<Type> partType,
330Lazy<IEnumerable<ImportDefinition>>? imports,
331Lazy<IEnumerable<ExportDefinition>>? exports,
332Lazy<IDictionary<string, object?>>? metadata,
350public Lazy<Type> GetLazyPartType()
465private readonly Lazy<IDictionary<string, object?>> _metadata;
467public LazyExportDefinition(string contractName, Lazy<IDictionary<string, object?>> metadata)
System.ComponentModel.TypeConverter (2)
System.Composition.Hosting (9)
System.Composition.TypedParts (2)
System.Console (1)
System.Core (1)
System.Drawing.Primitives (1)
System.Formats.Tar (1)
System.Net.Http (1)
System.Net.Ping (3)
System.Net.Quic (1)
System.Net.Security (3)
System.Private.CoreLib (32)
src\libraries\System.Private.CoreLib\src\System\Threading\LazyThreadSafetyMode.cs (13)
13/// Specifies how a <see cref="Lazy{T}"/> instance should synchronize access among multiple threads.
18/// This mode makes no guarantees around the thread-safety of the <see cref="Lazy{T}"/> instance. If used from multiple threads, the behavior of the <see cref="Lazy{T}"/> is undefined.
19/// This mode should be used when a <see cref="Lazy{T}"/> is guaranteed to never be initialized from more than one thread simultaneously and high performance is crucial.
20/// If valueFactory throws an exception when the <see cref="Lazy{T}"/> is initialized, the exception will be cached and returned on subsequent accesses to Value. Also, if valueFactory recursively
21/// accesses Value on this <see cref="Lazy{T}"/> instance, a <see cref="InvalidOperationException"/> will be thrown.
26/// When multiple threads attempt to simultaneously initialize a <see cref="Lazy{T}"/> instance, this mode allows each thread to execute the
27/// valueFactory but only the first thread to complete initialization will be allowed to set the final value of the <see cref="Lazy{T}"/>.
31/// the valueFactory delegate re-executing. Also, if valueFactory recursively accesses Value on this <see cref="Lazy{T}"/> instance, an exception will NOT be thrown.
36/// This mode uses locks to ensure that only a single thread can initialize a <see cref="Lazy{T}"/> instance in a thread-safe manner. In general,
37/// taken if this mode is used in conjunction with a <see cref="Lazy{T}"/> valueFactory delegate that uses locks internally, a deadlock can occur if not
38/// handled carefully. If valueFactory throws an exception when the<see cref="Lazy{T}"/> is initialized, the exception will be cached and returned on
39/// subsequent accesses to Value. Also, if valueFactory recursively accesses Value on this <see cref="Lazy{T}"/> instance, a <see cref="InvalidOperationException"/> will be thrown.
System.Private.Windows.Core.TestUtilities (2)
System.Private.Xml (1)
System.Reflection.Metadata (1)
System.Runtime (1)
System.Security.Cryptography (7)
System.ServiceModel.Http (1)
System.ServiceModel.Primitives (1)
System.Threading.RateLimiting (7)
System.Windows.Forms.Primitives.TestUtilities (1)
System.Xaml (56)
Test.Utilities (15)
Text.Analyzers (16)
xunit.assert (4)
xunit.console (4)