568 references to Lazy
aspire (1)
src\Shared\ColorGenerator.cs (1)
80return new Lazy<int>(() =>
Aspire.Azure.Data.Tables.Tests (1)
ConformanceTests.cs (1)
20private static readonly Lazy<bool> s_canConnectToServer = new(GetCanConnect);
Aspire.Azure.Messaging.ServiceBus.Tests (2)
ConformanceTests_Queue.cs (1)
16private static readonly Lazy<bool> s_canConnectToServer = new(GetCanConnect);
ConformanceTests_Topic.cs (1)
17private static readonly Lazy<bool> s_canConnectToServer = new(GetCanConnect);
Aspire.Azure.Security.KeyVault.Tests (3)
CertificateClientConformanceTests.cs (1)
19private static readonly Lazy<bool> s_canConnectToServer = new(GetCanConnect);
KeyClientConformanceTests.cs (1)
21private static readonly Lazy<bool> s_canConnectToServer = new(GetCanConnect);
SecretClientConformanceTests.cs (1)
20private static readonly Lazy<bool> s_canConnectToServer = new(GetCanConnect);
Aspire.Azure.Storage.Blobs.Tests (1)
ConformanceTests.cs (1)
20private static readonly Lazy<bool> s_canConnectToServer = new(GetCanConnect);
Aspire.Azure.Storage.Files.DataLake.Tests (1)
ConformanceTests.cs (1)
18private static readonly Lazy<bool> s_canConnectToServer = new(CanConnect);
Aspire.Azure.Storage.Queues.Tests (1)
ConformanceTests.cs (1)
20private static readonly Lazy<bool> s_canConnectToServer = new(GetCanConnect);
Aspire.Confluent.Kafka.Tests (5)
ReflectionHelpers.cs (5)
12public static readonly Lazy<Type> MetricsChannelType = new Lazy<Type>(() => ComponentAssembly.GetType("Aspire.Confluent.Kafka.MetricsChannel")!); 13public static readonly Lazy<Type> ProducerConnectionFactoryType = new Lazy<Type>(() => ComponentAssembly.GetType("Aspire.Confluent.Kafka.ProducerConnectionFactory`2")!); 14public static readonly Lazy<Type> ProducerConnectionFactoryStringKeyStringValueType = new Lazy<Type>(() => ProducerConnectionFactoryType.Value.MakeGenericType(typeof(string), typeof(string))); 15public static readonly Lazy<Type> ConsumerConnectionFactoryType = new Lazy<Type>(() => ComponentAssembly.GetType("Aspire.Confluent.Kafka.ConsumerConnectionFactory`2")!); 16public static readonly Lazy<Type> ConsumerConnectionFactoryStringKeyStringValueType = new Lazy<Type>(() => ConsumerConnectionFactoryType.Value.MakeGenericType(typeof(string), typeof(string)));
Aspire.Dashboard (5)
Model\ResourceViewModel.cs (3)
59public ImmutableArray<string> CachedAddresses => (_cachedAddresses ??= new Lazy<ImmutableArray<string>>(ExtractResourceAddresses)).Value; 338_tooltip = new(() => propertyViewModel.Value.HasStringValue ? propertyViewModel.Value.StringValue : propertyViewModel.Value.ToString()); 340_displayValue = new(() =>
src\Shared\ColorGenerator.cs (1)
80return new Lazy<int>(() =>
Utils\VersionHelpers.cs (1)
11private static readonly Lazy<string?> s_cachedRuntimeVersion = new Lazy<string?>(GetRuntimeVersion);
Aspire.Dashboard.Components.Tests (2)
UseCultureAttribute.cs (2)
45this._culture = new Lazy<CultureInfo>(() => new CultureInfo(culture, false)); 46this._uiCulture = new Lazy<CultureInfo>(() => new CultureInfo(uiCulture, false));
Aspire.EndToEnd.Tests (5)
tests\Shared\TemplatesTesting\AspireProject.cs (1)
25public static Lazy<HttpClient> Client => new(CreateHttpClient);
tests\Shared\TemplatesTesting\BuildEnvironment.cs (4)
40private static readonly Lazy<BuildEnvironment> s_instance_80 = new(() => 43private static readonly Lazy<BuildEnvironment> s_instance_90 = new(() => 46private static readonly Lazy<BuildEnvironment> s_instance_100 = new(() => 49private static readonly Lazy<BuildEnvironment> s_instance_100_90_80 = new(() =>
Aspire.Hosting (10)
ApplicationModel\ParameterResource.cs (1)
30_lazyValue = new Lazy<string>(() => _valueGetter(Default));
DeveloperCertificateService.cs (3)
22_certificates = new Lazy<ImmutableList<X509Certificate2>>(() => 71_supportsContainerTrust = new Lazy<bool>(() => 78_supportsTlsTermination = new Lazy<bool>(() =>
DistributedApplicationOptions.cs (6)
31_assembly = new(ResolveAssembly); 32_projectDirectoryLazy = new(ResolveProjectDirectory); 33_projectNameLazy = new(ResolveProjectName); 34_dashboardApplicationNameLazy = new(ResolveDashboardApplicationName); 35_appHostFilePathLazy = new(ResolveAppHostFilePath); 36_configurationLazy = new(ResolveConfiguration);
Aspire.Hosting.Azure (7)
AzureResourcePreparer.cs (6)
312new(() => RoleManagementPrincipalType.ServicePrincipal), 313new(() => appIdentityResource.PrincipalId.AsProvisioningParameter(infra, parameterName: AzureBicepResource.KnownParameters.PrincipalId)), 314new(() => appIdentityResource.PrincipalName.AsProvisioningParameter(infra, parameterName: AzureBicepResource.KnownParameters.PrincipalName))); 417new(() => CreatePrincipalParam(AzureBicepResource.KnownParameters.PrincipalType)), 418new(() => CreatePrincipalParam(AzureBicepResource.KnownParameters.PrincipalId)), 419new(() => CreatePrincipalParam(AzureBicepResource.KnownParameters.PrincipalName)));
Provisioning\Provisioners\AzureProvisioner.cs (1)
166var provisioningContextLazy = new Lazy<Task<ProvisioningContext>>(() => provisioningContextProvider.CreateProvisioningContextAsync(cancellationToken));
Aspire.Hosting.JavaScript (1)
JavaScriptHostingExtensions.cs (1)
158var defaultBaseImage = new Lazy<string>(() => GetDefaultBaseImage(appDirectory, "alpine", dockerfileContext.Services));
Aspire.Hosting.RemoteHost.Tests (4)
AtsMarshallerTests.cs (1)
40return new AtsMarshaller(handles, context, ctRegistry, new Lazy<AtsCallbackProxyFactory>(() => throw new NotImplementedException()));
CallbackProxyTests.cs (1)
352var marshaller = new AtsMarshaller(handles, context, ctRegistry, new Lazy<AtsCallbackProxyFactory>(() => throw new NotImplementedException()));
CapabilityDispatcherTests.cs (2)
1330return new AtsMarshaller(handles, context, ctRegistry, new Lazy<AtsCallbackProxyFactory>(() => throw new NotImplementedException())); 1340var marshaller = new AtsMarshaller(handles, context, ctRegistry, new Lazy<AtsCallbackProxyFactory>(() => callbackFactory!));
Aspire.Hosting.Testing.Tests (1)
DistributedApplicationHttpClientExtensionsForTests.cs (1)
11private static readonly Lazy<IHttpClientFactory> s_httpClientFactory = new(CreateHttpClientFactoryWithResilience);
Aspire.Hosting.Tests (1)
tests\Aspire.Hosting.Testing.Tests\DistributedApplicationHttpClientExtensionsForTests.cs (1)
11private static readonly Lazy<IHttpClientFactory> s_httpClientFactory = new(CreateHttpClientFactoryWithResilience);
Aspire.StackExchange.Redis (1)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\Implementation\RedisProfilerEntryToActivityConverter.cs (1)
19private static readonly Lazy<Func<object, (string?, string?)>> MessageDataGetter = new(() =>
Aspire.Templates.Tests (6)
TemplateTestsBase.cs (1)
22private static Lazy<IBrowser> Browser => new(CreateBrowser);
tests\Shared\TemplatesTesting\AspireProject.cs (1)
25public static Lazy<HttpClient> Client => new(CreateHttpClient);
tests\Shared\TemplatesTesting\BuildEnvironment.cs (4)
40private static readonly Lazy<BuildEnvironment> s_instance_80 = new(() => 43private static readonly Lazy<BuildEnvironment> s_instance_90 = new(() => 46private static readonly Lazy<BuildEnvironment> s_instance_100 = new(() => 49private static readonly Lazy<BuildEnvironment> s_instance_100_90_80 = new(() =>
Aspire.TestUtilities (2)
UseCultureAttribute.cs (2)
26private readonly Lazy<CultureInfo> _culture = new(() => new(culture, useUserOverride: false)); 27private readonly Lazy<CultureInfo> _uiCulture = new(() => new(uiCulture, useUserOverride: false));
aspire-server (5)
AssemblyLoader.cs (1)
31_assemblies = new Lazy<IReadOnlyList<Assembly>>(() => LoadAssemblies(configuration, logger));
AtsContextFactory.cs (1)
19_context = new Lazy<AtsContext>(() => Create(assemblyLoader.GetAssemblies(), logger));
CodeGeneration\CodeGeneratorResolver.cs (1)
25_generators = new Lazy<Dictionary<string, ICodeGenerator>>(
Language\LanguageSupportResolver.cs (1)
25_languages = new Lazy<Dictionary<string, ILanguageSupport>>(
RemoteHostServer.cs (1)
59services.AddScoped(sp => new Lazy<AtsCallbackProxyFactory>(() => sp.GetRequiredService<AtsCallbackProxyFactory>()));
dotnet-svcutil-lib (1)
FrameworkFork\Microsoft.Xml\Xml\Serialization\SourceInfo.cs (1)
22private static readonly Lazy<MethodInfo> s_iListGetItemMethod = new Lazy<MethodInfo>(
GenerateDocumentationAndConfigFiles (5)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
26private static readonly Lazy<Encoding> s_fallbackEncoding = new(CreateFallbackEncoding);
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (2)
62globalOptions = new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => SyntaxTreeCategorizedAnalyzerConfigOptions.Create(analyzerConfigOptionsProvider.GlobalOptions)); 70perTreeOptionsBuilder.Add(tree, new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => Create(tree, analyzerConfigOptionsProvider)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
31_lazyNamingStylePreferences = new Lazy<NamingStylePreferences>(() => EditorConfigNamingStyleParser.ParseDictionary(_options));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigFile.cs (1)
23private readonly Lazy<ImmutableArray<Section>> _sections = new(() => Options.SelectAsArray(x => x.Section).Distinct());
ILLink.RoslynAnalyzer (1)
DynamicallyAccessedMembersAnalyzer.cs (1)
27public static Lazy<ImmutableArray<RequiresAnalyzerBase>> RequiresAnalyzers { get; } = new Lazy<ImmutableArray<RequiresAnalyzerBase>>(GetRequiresAnalyzers);
Infrastructure.Common (1)
TestProperties.cs (1)
19private static Lazy<Dictionary<String, String>> s_properties = new Lazy<Dictionary<String, String>>(() =>
Metrics (5)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
26private static readonly Lazy<Encoding> s_fallbackEncoding = new(CreateFallbackEncoding);
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (2)
62globalOptions = new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => SyntaxTreeCategorizedAnalyzerConfigOptions.Create(analyzerConfigOptionsProvider.GlobalOptions)); 70perTreeOptionsBuilder.Add(tree, new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => Create(tree, analyzerConfigOptionsProvider)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
31_lazyNamingStylePreferences = new Lazy<NamingStylePreferences>(() => EditorConfigNamingStyleParser.ParseDictionary(_options));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigFile.cs (1)
23private readonly Lazy<ImmutableArray<Section>> _sections = new(() => Options.SelectAsArray(x => x.Section).Distinct());
Metrics.Legacy (5)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
26private static readonly Lazy<Encoding> s_fallbackEncoding = new(CreateFallbackEncoding);
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (2)
62globalOptions = new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => SyntaxTreeCategorizedAnalyzerConfigOptions.Create(analyzerConfigOptionsProvider.GlobalOptions)); 70perTreeOptionsBuilder.Add(tree, new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => Create(tree, analyzerConfigOptionsProvider)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
31_lazyNamingStylePreferences = new Lazy<NamingStylePreferences>(() => EditorConfigNamingStyleParser.ParseDictionary(_options));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigFile.cs (1)
23private readonly Lazy<ImmutableArray<Section>> _sections = new(() => Options.SelectAsArray(x => x.Section).Distinct());
Microsoft.AspNetCore.DataProtection (3)
Internal\ContainerUtils.cs (1)
14private static readonly Lazy<bool> _isContainer = new Lazy<bool>(IsProcessRunningInContainer);
Repositories\DefaultKeyStorageDirectories.cs (1)
13private static readonly Lazy<DirectoryInfo?> _defaultDirectoryLazy = new Lazy<DirectoryInfo?>(GetKeyStorageDirectoryImpl);
Repositories\RegistryXmlRepository.cs (1)
23private static readonly Lazy<RegistryKey?> _defaultRegistryKeyLazy = new Lazy<RegistryKey?>(GetDefaultHklmStorageKey);
Microsoft.AspNetCore.DataProtection.Tests (3)
Internal\KeyManagementOptionsSetupTest.cs (1)
114private static readonly Lazy<RegistryKey> LazyHkcuTempKey = new Lazy<RegistryKey>(() =>
RegistryPolicyResolverTests.cs (1)
286private static readonly Lazy<RegistryKey> LazyHkcuTempKey = new Lazy<RegistryKey>(() =>
Repositories\RegistryXmlRepositoryTests.cs (1)
237private static readonly Lazy<RegistryKey> LazyHkcuTempKey = new Lazy<RegistryKey>(() =>
Microsoft.AspNetCore.Http.Extensions (2)
src\Shared\ParameterBindingMethodCache.cs (2)
30private static readonly Lazy<ParameterBindingMethodCache> _instance = new(() => new ParameterBindingMethodCache()); 32private static readonly Lazy<ParameterBindingMethodCache> _nonThrowingInstance = new(() => new ParameterBindingMethodCache(throwOnInvalidMethod: false));
Microsoft.AspNetCore.HttpsPolicy (1)
HttpsRedirectionMiddleware.cs (1)
52_httpsPort = new Lazy<int>(TryGetHttpsPort);
Microsoft.AspNetCore.InternalTesting (1)
TestContext.cs (1)
34_files = new Lazy<TestFileOutputContext>(() => new TestFileOutputContext(this));
Microsoft.AspNetCore.Mvc.Abstractions (2)
src\Shared\ParameterBindingMethodCache.cs (2)
30private static readonly Lazy<ParameterBindingMethodCache> _instance = new(() => new ParameterBindingMethodCache()); 32private static readonly Lazy<ParameterBindingMethodCache> _nonThrowingInstance = new(() => new ParameterBindingMethodCache(throwOnInvalidMethod: false));
Microsoft.AspNetCore.Mvc.Core (1)
Filters\MiddlewareFilterBuilder.cs (1)
37key => new Lazy<RequestDelegate>(() => BuildPipeline(key)));
Microsoft.AspNetCore.OpenApi (2)
src\Shared\ParameterBindingMethodCache.cs (2)
30private static readonly Lazy<ParameterBindingMethodCache> _instance = new(() => new ParameterBindingMethodCache()); 32private static readonly Lazy<ParameterBindingMethodCache> _nonThrowingInstance = new(() => new ParameterBindingMethodCache(throwOnInvalidMethod: false));
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Deployers\RemoteWindowsDeployer\RemoteWindowsDeployer.cs (1)
22private static readonly Lazy<Scripts> _scripts = new Lazy<Scripts>(CopyEmbeddedScriptFilesToDisk);
Microsoft.AspNetCore.SignalR.Core (2)
Internal\DefaultHubActivator.cs (1)
13private static readonly Lazy<ObjectFactory> _objectFactory = new Lazy<ObjectFactory>(() => ActivatorUtilities.CreateFactory(typeof(THub), Type.EmptyTypes));
Internal\TypedClientBuilder.cs (1)
17private static readonly Lazy<Func<IClientProxy, T>> _builder = new Lazy<Func<IClientProxy, T>>(GenerateClientBuilder);
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (1)
Docker.cs (1)
22private static readonly Lazy<Docker> _instance = new Lazy<Docker>(Create);
Microsoft.AspNetCore.WebSockets.ConformanceTests (1)
Autobahn\Wstest.cs (1)
11private static readonly Lazy<Wstest> _instance = new Lazy<Wstest>(Create);
Microsoft.Build (29)
BackEnd\Components\Communications\TranslatorExtensions.cs (1)
23private static readonly Lazy<ConcurrentDictionary<Type, ConstructorInfo>> parameterlessConstructorCache = new Lazy<ConcurrentDictionary<Type, ConstructorInfo>>(() => new ConcurrentDictionary<Type, ConstructorInfo>());
BackEnd\Components\ProjectCache\ProjectCacheService.cs (1)
170descriptor => new Lazy<Task<ProjectCachePlugin>>(() => CreateAndInitializePluginAsync(descriptor, projectGraph, buildRequestConfiguration, requestedTargets, cancellationToken)))
BackEnd\Components\SdkResolution\CachingSdkResolverService.cs (1)
63key => new Lazy<SdkResult>(() =>
BackEnd\Components\SdkResolution\OutOfProcNodeSdkResolverService.cs (1)
81key => new Lazy<SdkResult>(() =>
DebugUtils.cs (1)
160private static readonly Lazy<NodeMode?> ProcessNodeMode = new(
Definition\Toolset.cs (2)
228_defaultSubToolsetVersionLazy = new Lazy<string>(ComputeDefaultSubToolsetVersion); 311_defaultSubToolsetVersionLazy = new Lazy<string>(ComputeDefaultSubToolsetVersion);
Definition\ToolsetConfigurationReader.cs (1)
51private static readonly Lazy<Configuration> s_configurationCache = new Lazy<Configuration>(ReadOpenMappedExeConfiguration);
Evaluation\IntrinsicFunctions.cs (1)
53private static readonly Lazy<NuGetFrameworkWrapper> NuGetFramework = new Lazy<NuGetFrameworkWrapper>(() => NuGetFrameworkWrapper.CreateInstance());
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));
FrameworkLocationHelper.cs (3)
237private static readonly Lazy<VisualStudioSpec[]> VisualStudioSpecs = new(() => 433private static readonly Lazy<IReadOnlyDictionary<Version, DotNetFrameworkSpec>> DotNetFrameworkSpecDict = new(() => DotNetFrameworkSpecs().ToDictionary(spec => spec.Version)); 434private static readonly Lazy<IReadOnlyDictionary<Version, VisualStudioSpec>> VisualStudioSpecDict = new(() => VisualStudioSpecs.Value.ToDictionary(spec => spec.Version));
Graph\GraphBuilder.cs (1)
603new Lazy<ProjectInstance>(() => _projectInstanceFactory(projectPath, globalProperties, projectCollection))).Value;
Graph\ParallelWorkSet.cs (1)
112var workItem = new Lazy<TResult>(workFunc);
Graph\ProjectGraph.cs (1)
449_projectNodesTopologicallySorted = new Lazy<IReadOnlyCollection<ProjectGraphNode>>(() => TopologicalSort(GraphRoots, ProjectNodes));
InprocTrackingNativeMethods.cs (1)
153private static readonly Lazy<string> fileTrackerDllName = new Lazy<string>(() => RuntimeInformation.ProcessArchitecture == Architecture.Arm64 ? "FileTrackerA4.dll" : (IntPtr.Size == sizeof(Int32)) ? "FileTracker32.dll" : "FileTracker64.dll");
Instance\HostServices.cs (2)
60private Lazy<IRunningObjectTableWrapper> _runningObjectTable = new Lazy<IRunningObjectTableWrapper>(() => new RunningObjectTable()); 380_runningObjectTable = new Lazy<IRunningObjectTableWrapper>(() => runningObjectTable);
Instance\TaskFactoryWrapper.cs (1)
100_propertyData = new Lazy<PropertyData>(PopulatePropertyInfo);
PrintLineDebugger.cs (3)
25private static readonly Lazy<PropertyInfo> CommonWriterProperty = new Lazy<PropertyInfo>( 38new Lazy<PrintLineDebugger>(() => Create(null, null, false)); 41new Lazy<PrintLineDebugger>(() => Create(null, null, true));
PrintLineDebuggerWriters.cs (1)
71private static readonly Lazy<string> _artifactsLogs = new Lazy<string>(
TypeLoader.cs (1)
84private static readonly Lazy<string[]> runtimeAssembliesCLR35_20 = new Lazy<string[]>(FindRuntimeAssembliesWithMicrosoftBuildFrameworkCLR2CLR35);
Utilities\EngineFileUtilities.cs (1)
588private static readonly Lazy<ConcurrentDictionary<string, bool>> _regexMatchCache = new Lazy<ConcurrentDictionary<string, bool>>(() => new ConcurrentDictionary<string, bool>(StringComparer.OrdinalIgnoreCase));
Microsoft.Build.Engine.OM.UnitTests (5)
DebugUtils.cs (1)
160private static readonly Lazy<NodeMode?> ProcessNodeMode = new(
PrintLineDebugger.cs (3)
25private static readonly Lazy<PropertyInfo> CommonWriterProperty = new Lazy<PropertyInfo>( 38new Lazy<PrintLineDebugger>(() => Create(null, null, false)); 41new Lazy<PrintLineDebugger>(() => Create(null, null, true));
PrintLineDebuggerWriters.cs (1)
71private static readonly Lazy<string> _artifactsLogs = new Lazy<string>(
Microsoft.Build.Engine.UnitTests (1)
ProjectCache\ProjectCacheTests.cs (1)
75new Lazy<string>(
Microsoft.Build.Framework (3)
AssemblyUtilities.cs (1)
33private static Lazy<Assembly> s_entryAssembly = new Lazy<Assembly>(() => GetEntryAssembly());
FileClassifier.cs (1)
76private static readonly Lazy<FileClassifier> s_sharedInstance = new(() => new FileClassifier());
NativeMethods.cs (1)
844private static readonly Lazy<bool> s_isFileSystemCaseSensitive = new(() =>
Microsoft.Build.Tasks.Core (32)
AssemblyDependency\AssemblyFoldersFromConfig\AssemblyFoldersFromConfigResolver.cs (1)
26private static readonly Lazy<Regex> s_crackAssemblyFoldersFromConfigSentinel = new Lazy<Regex>(
CultureInfoCache.cs (1)
27private static readonly Lazy<HashSet<string>> ValidCultureNames = new Lazy<HashSet<string>>(() => InitializeValidCultureNames());
DebugUtils.cs (1)
160private static readonly Lazy<NodeMode?> ProcessNodeMode = new(
Exec.cs (1)
498private static readonly Lazy<string> CommandProcessorPath = new Lazy<string>(() =>
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));
FileState.cs (3)
243_data = new Lazy<FileDirInfo>(() => new FileDirInfo(Path)); 312_data = new Lazy<FileDirInfo>(() => new FileDirInfo(value)); 335_data = new Lazy<FileDirInfo>(() => new FileDirInfo(Path));
GetFrameworkPath.cs (16)
36private static readonly Lazy<string> s_path = new Lazy<string>(() => ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Latest)); 37private static readonly Lazy<string> s_version11Path = new Lazy<string>(() => ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version11)); 38private static readonly Lazy<string> s_version20Path = new Lazy<string>(() => ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version20)); 39private static readonly Lazy<string> s_version30Path = new Lazy<string>(() => ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version30)); 40private static readonly Lazy<string> s_version35Path = new Lazy<string>(() => ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version35)); 41private static readonly Lazy<string> s_version40Path = new Lazy<string>(() => ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version40)); 42private static readonly Lazy<string> s_version45Path = new Lazy<string>(() => ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version45)); 43private static readonly Lazy<string> s_version451Path = new Lazy<string>(() => ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version451)); 44private static readonly Lazy<string> s_version452Path = new Lazy<string>(() => ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version452)); 45private static readonly Lazy<string> s_version46Path = new Lazy<string>(() => ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version46)); 46private static readonly Lazy<string> s_version461Path = new Lazy<string>(() => ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version461)); 47private static readonly Lazy<string> s_version462Path = new Lazy<string>(() => ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version462)); 48private static readonly Lazy<string> s_version47Path = new Lazy<string>(() => ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version47)); 49private static readonly Lazy<string> s_version471Path = new Lazy<string>(() => ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version471)); 50private static readonly Lazy<string> s_version472Path = new Lazy<string>(() => ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version472)); 51private static readonly Lazy<string> s_version48Path = new Lazy<string>(() => ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version48));
PrintLineDebugger.cs (3)
25private static readonly Lazy<PropertyInfo> CommonWriterProperty = new Lazy<PropertyInfo>( 38new Lazy<PrintLineDebugger>(() => Create(null, null, false)); 41new Lazy<PrintLineDebugger>(() => Create(null, null, true));
PrintLineDebuggerWriters.cs (1)
71private static readonly Lazy<string> _artifactsLogs = new Lazy<string>(
RoslynCodeTaskFactory\RoslynCodeTaskFactory.cs (1)
92private static readonly Lazy<string> ThisAssemblyDirectoryLazy = new Lazy<string>(() => Path.GetDirectoryName(typeof(RoslynCodeTaskFactory).GetTypeInfo().Assembly.ManifestModule.FullyQualifiedName));
Microsoft.Build.UnitTests.Shared (2)
DummyMappedDriveUtils.cs (1)
23public static Lazy<DummyMappedDrive?> GetLazyDummyMappedDrive() => new Lazy<DummyMappedDrive?>(() =>
TestEnvironment.cs (1)
85_defaultTestDirectory = new Lazy<TransientTestFolder>(() => CreateFolder());
Microsoft.Build.Utilities.Core (12)
DebugUtils.cs (1)
160private static readonly Lazy<NodeMode?> ProcessNodeMode = new(
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));
FrameworkLocationHelper.cs (3)
237private static readonly Lazy<VisualStudioSpec[]> VisualStudioSpecs = new(() => 433private static readonly Lazy<IReadOnlyDictionary<Version, DotNetFrameworkSpec>> DotNetFrameworkSpecDict = new(() => DotNetFrameworkSpecs().ToDictionary(spec => spec.Version)); 434private static readonly Lazy<IReadOnlyDictionary<Version, VisualStudioSpec>> VisualStudioSpecDict = new(() => VisualStudioSpecs.Value.ToDictionary(spec => spec.Version));
PrintLineDebugger.cs (3)
25private static readonly Lazy<PropertyInfo> CommonWriterProperty = new Lazy<PropertyInfo>( 38new Lazy<PrintLineDebugger>(() => Create(null, null, false)); 41new Lazy<PrintLineDebugger>(() => Create(null, null, true));
PrintLineDebuggerWriters.cs (1)
71private static readonly Lazy<string> _artifactsLogs = new Lazy<string>(
Microsoft.CodeAnalysis (15)
AdditionalTextFile.cs (1)
34_text = new Lazy<SourceText?>(ReadText);
CommandLine\CommandLineArguments.cs (1)
319_lazyManifestResources = new Lazy<ImmutableArray<ResourceDescription>>(
CommandLine\CommonCompiler.cs (1)
74private readonly Lazy<Encoding> _fallbackEncoding = new Lazy<Encoding>(EncodedStringText.CreateFallbackEncoding);
CommandLine\CommonCompiler.ExistingReferencesResolver.cs (1)
37_lazyAvailableReferences = new Lazy<HashSet<AssemblyIdentity>>(() => new HashSet<AssemblyIdentity>(
Compilation\Compilation.cs (1)
95_lazyDataSectionStringLiteralThreshold = new Lazy<int?>(ComputeDataSectionStringLiteralThreshold);
Compilation\CompilationOptions.cs (1)
326_lazyErrors = new Lazy<ImmutableArray<Diagnostic>>(() =>
Compilation\ParseOptions.cs (1)
45_lazyErrors = new Lazy<ImmutableArray<Diagnostic>>(() =>
DiagnosticAnalyzer\AnalysisScope.cs (1)
154_lazyAnalyzersSet = new Lazy<ImmutableHashSet<DiagnosticAnalyzer>>(CreateAnalyzersSet);
DiaSymReader\SymUnmanagedFactory.cs (1)
79private static readonly Lazy<Func<string, string>> s_lazyGetEnvironmentVariable = new Lazy<Func<string, string>>(() =>
Emit\CommonPEModuleBuilder.cs (1)
73_stringsInILMap = new Lazy<StringTokenMap>(() => new StringTokenMap(PreviousGeneration?.UserStringStreamLength ?? 0));
EncodedStringText.cs (1)
26private static readonly Lazy<Encoding> s_fallbackEncoding = new(CreateFallbackEncoding);
MetadataReader\PEModule.cs (2)
157_lazyTypeNameCollection = new Lazy<IdentifierCollection>(ComputeTypeNameCollection); 158_lazyNamespaceNameCollection = new Lazy<IdentifierCollection>(ComputeNamespaceNameCollection);
SourceGeneration\SyntaxStore.cs (2)
89var root = new Lazy<SyntaxNode>(() => tree.GetRoot(_cancellationToken)); 90var model = state != EntryState.Removed ? new Lazy<SemanticModel>(() => _compilation.GetSemanticModel(tree)) : null;
Microsoft.CodeAnalysis.Analyzers (6)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
26private static readonly Lazy<Encoding> s_fallbackEncoding = new(CreateFallbackEncoding);
src\RoslynAnalyzers\Microsoft.CodeAnalysis.BannedApiAnalyzers\Core\SymbolIsBannedAnalyzerBase.cs (1)
441_lazySymbols = new Lazy<ImmutableArray<ISymbol>>(
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (2)
62globalOptions = new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => SyntaxTreeCategorizedAnalyzerConfigOptions.Create(analyzerConfigOptionsProvider.GlobalOptions)); 70perTreeOptionsBuilder.Add(tree, new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => Create(tree, analyzerConfigOptionsProvider)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
31_lazyNamingStylePreferences = new Lazy<NamingStylePreferences>(() => EditorConfigNamingStyleParser.ParseDictionary(_options));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigFile.cs (1)
23private readonly Lazy<ImmutableArray<Section>> _sections = new(() => Options.SelectAsArray(x => x.Section).Distinct());
Microsoft.CodeAnalysis.AnalyzerUtilities (9)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
26private static readonly Lazy<Encoding> s_fallbackEncoding = new(CreateFallbackEncoding);
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (2)
62globalOptions = new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => SyntaxTreeCategorizedAnalyzerConfigOptions.Create(analyzerConfigOptionsProvider.GlobalOptions)); 70perTreeOptionsBuilder.Add(tree, new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => Create(tree, analyzerConfigOptionsProvider)));
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataAnalysis.TaintedDataOperationVisitor.cs (4)
310new Lazy<PointsToAnalysisResult?>(() => DataFlowAnalysisContext.PointsToAnalysisResult), 311new Lazy<(PointsToAnalysisResult?, ValueContentAnalysisResult?)>(() => (DataFlowAnalysisContext.PointsToAnalysisResult, DataFlowAnalysisContext.ValueContentAnalysisResult)), 686Lazy<HashSet<SinkKind>> lazySinkKinds = new Lazy<HashSet<SinkKind>>(() => []); 727Lazy<HashSet<SinkKind>> lazySinkKinds = new Lazy<HashSet<SinkKind>>(() => []);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
31_lazyNamingStylePreferences = new Lazy<NamingStylePreferences>(() => EditorConfigNamingStyleParser.ParseDictionary(_options));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigFile.cs (1)
23private readonly Lazy<ImmutableArray<Section>> _sections = new(() => Options.SelectAsArray(x => x.Section).Distinct());
Microsoft.CodeAnalysis.BannedApiAnalyzers (6)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
26private static readonly Lazy<Encoding> s_fallbackEncoding = new(CreateFallbackEncoding);
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (2)
62globalOptions = new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => SyntaxTreeCategorizedAnalyzerConfigOptions.Create(analyzerConfigOptionsProvider.GlobalOptions)); 70perTreeOptionsBuilder.Add(tree, new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => Create(tree, analyzerConfigOptionsProvider)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
31_lazyNamingStylePreferences = new Lazy<NamingStylePreferences>(() => EditorConfigNamingStyleParser.ParseDictionary(_options));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigFile.cs (1)
23private readonly Lazy<ImmutableArray<Section>> _sections = new(() => Options.SelectAsArray(x => x.Section).Distinct());
SymbolIsBannedAnalyzerBase.cs (1)
441_lazySymbols = new Lazy<ImmutableArray<ISymbol>>(
Microsoft.CodeAnalysis.CodeStyle (4)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
41_lazySupportedCompilerErrorCodes = new Lazy<ImmutableHashSet<int>>(GetSupportedCompilerErrorCodes);
src\Compilers\Core\Portable\EncodedStringText.cs (1)
26private static readonly Lazy<Encoding> s_fallbackEncoding = new(CreateFallbackEncoding);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
31_lazyNamingStylePreferences = new Lazy<NamingStylePreferences>(() => EditorConfigNamingStyleParser.ParseDictionary(_options));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigFile.cs (1)
23private readonly Lazy<ImmutableArray<Section>> _sections = new(() => Options.SelectAsArray(x => x.Section).Distinct());
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
Host\Mef\CodeStyleHostLanguageServices.cs (1)
77=> _compositionContext.GetExports<TExtension>().Select(e => new Lazy<TExtension>(() => e));
Microsoft.CodeAnalysis.CSharp (4)
CommandLine\CommandLineDiagnosticFormatter.cs (1)
25_lazyNormalizedBaseDirectory = new Lazy<string>(() => FileUtilities.TryNormalizeAbsolutePath(baseDirectory));
Compilation\MemberSemanticModel.cs (1)
63_operationFactory = new Lazy<CSharpOperationFactory>(() => new CSharpOperationFactory(this));
Compilation\SyntaxAndDeclarationManager.cs (1)
299var lazyRoot = new Lazy<RootSingleNamespaceDeclaration>(() => DeclarationTreeBuilder.ForTree(tree, scriptClassName, isSubmission, lastComputedMemberNames));
Errors\ErrorFacts.cs (1)
21private static readonly Lazy<ImmutableDictionary<ErrorCode, string>> s_categoriesMap = new Lazy<ImmutableDictionary<ErrorCode, string>>(CreateCategoriesMap);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
PdbSourceDocument\PdbSourceDocumentLoaderServiceTests.cs (2)
38var sourceLinkService = new Lazy<ISourceLinkService>(() => new TestSourceLinkService(sourceFilePath: sourceFilePath)); 69var sourceLinkService = new Lazy<ISourceLinkService>(() => new TestSourceLinkService(sourceFilePath: sourceFilePath));
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (1)
InteractiveSessionReferencesTests.cs (1)
238private static readonly Lazy<bool> s_isSystemV2AndV4Available = new Lazy<bool>(() =>
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
DeclarationTests.cs (1)
197return new Lazy<RootSingleNamespaceDeclaration>(() => decl);
Microsoft.CodeAnalysis.EditorFeatures (5)
EditorConfigSettings\Updater\NamingStyles\SourceTextExtensions.cs (3)
112private static readonly Lazy<NamingRuleComparerIgnoreGUIDs> s_lazyInstance = new(() => new NamingRuleComparerIgnoreGUIDs()); 133private static readonly Lazy<NamingStyleComparerIgnoreGUIDs> s_lazyInstance = new(() => new NamingStyleComparerIgnoreGUIDs()); 158private static readonly Lazy<SymbolSpecificationComparerIgnoreGUIDs> s_lazyInstance = new(() => new SymbolSpecificationComparerIgnoreGUIDs());
InlineRename\UI\SmartRename\SmartRenameUserInputComboBox.xaml.cs (1)
36_innerTextBox = new Lazy<TextBox>(() =>
NavigateTo\DefaultNavigateToPreviewServiceFactory.cs (1)
18new(() => new DefaultNavigateToPreviewService());
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
CodeFixes\CodeFixServiceTests.cs (3)
53var logger = SpecializedCollections.SingletonEnumerable(new Lazy<IErrorLoggerService>(() => workspace.Services.GetRequiredService<IErrorLoggerService>())); 345var logger = SpecializedCollections.SingletonEnumerable(new Lazy<IErrorLoggerService>(() => new TestErrorLogger())); 741var logger = SpecializedCollections.SingletonEnumerable(new Lazy<IErrorLoggerService>(() => workspace.Services.GetRequiredService<IErrorLoggerService>()));
Microsoft.CodeAnalysis.Features (15)
CodeFixes\Service\CodeFixService.cs (3)
68_fixersPerLanguageMap = new(() => _fixers.ToPerLanguageMapWithMultipleLanguages()); 70_configurationProvidersMap = new(() => GetConfigurationProvidersPerLanguageMap(configurationProviders)); 949var lazyConfigurationFixers = new Lazy<ImmutableArray<IConfigurationFixProvider>>(() => GetConfigurationFixProviders(lazyFixers));
CodeRefactorings\CodeRefactoringService.cs (3)
34new(() => 39new Lazy<ImmutableArray<CodeRefactoringProvider>>(() => [.. ExtensionOrderer.Order(grp).Select(lz => lz.Value)]))))); 41private readonly Lazy<ImmutableDictionary<CodeRefactoringProvider, CodeChangeProviderMetadata>> _lazyRefactoringToMetadataMap = new(() => providers.Where(provider => provider.IsValueCreated).ToImmutableDictionary(provider => provider.Value, provider => provider.Metadata));
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (1)
121var editorBrowsableInfo = new Lazy<EditorBrowsableInfo>(() => new EditorBrowsableInfo(originCompilation));
Completion\Providers\Scripting\GlobalAssemblyCacheCompletionHelper.cs (1)
19new(() => [.. GlobalAssemblyCache.Instance.GetAssemblySimpleNames()]);
EditAndContinue\EditAndContinueDebugInfoReader.cs (1)
131_lazyDefaultSourceFileEncoding = new(ReadDefaultSourceFileEncoding);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.AbstractUnitTestingPriorityProcessor.cs (1)
58_lazyAnalyzers = new Lazy<ImmutableArray<IUnitTestingIncrementalAnalyzer>>(() => analyzers.Add(analyzer));
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingIncrementalAnalyzerProcessor.cs (1)
57var lazyAllAnalyzers = new Lazy<ImmutableArray<IUnitTestingIncrementalAnalyzer>>(() => GetIncrementalAnalyzers(_registration, analyzersGetter, onlyHighPriorityAnalyzer: false));
Intents\IntentDataProvider.cs (1)
15private static readonly Lazy<JsonSerializerOptions> s_serializerOptions = new(() =>
MetadataAsSource\MetadataAsSourceFileService.cs (1)
61_providers = new(() => [.. ExtensionOrderer.Order(providers)]);
NavigateTo\RoslynNavigateToItem.cs (1)
120_secondarySort = new Lazy<string>(ComputeSecondarySort);
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
41_lazySupportedCompilerErrorCodes = new Lazy<ImmutableHashSet<int>>(GetSupportedCompilerErrorCodes);
Microsoft.CodeAnalysis.LanguageServer (5)
DotnetCliHelper.cs (1)
27_dotnetExecutablePath = new Lazy<string>(() => GetDotNetPathOrDefault());
FileBasedPrograms\CanonicalMiscFilesProjectLoader.cs (1)
55_canonicalDocumentPath = new Lazy<string>(() =>
HostWorkspace\FileWatching\DelegatingFileChangeWatcher.cs (1)
32private readonly Lazy<IFileChangeWatcher> _underlyingFileWatcher = new(() =>
HostWorkspace\LoadedProject.cs (1)
248_mostRecentFileMatchers = new Lazy<ImmutableArray<Matcher>>(() =>
Logging\LspLogMessageLogger.cs (1)
18private readonly Lazy<ILogger> _fallbackLogger = new(() => fallbackLoggerFactory.CreateLogger(categoryName));
Microsoft.CodeAnalysis.LanguageServer.Protocol (8)
LspServices\AbstractExportLspServiceAttribute.cs (1)
78? new(() => CreateMethodHandlerData(serviceType))
RoslynLanguageServer.cs (1)
26private static readonly Lazy<int> s_currentProcessId = new(static () => { using var process = Process.GetCurrentProcess(); return process.Id; });
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\AbstractLanguageServer.cs (3)
74_lspServices = new Lazy<ILspServices>(() => ConstructLspServices()); 75_queue = new Lazy<IRequestExecutionQueue<TRequestContext>>(() => ConstructRequestExecutionQueue()); 76_handlerProvider = new Lazy<AbstractHandlerProvider>(() =>
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\HandlerProvider.cs (2)
100return new(() => instance); 105return new(() =>
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\RequestExecutionQueue.cs (1)
106languages.Add(metadata.Language, new(() =>
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (5)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
26private static readonly Lazy<Encoding> s_fallbackEncoding = new(CreateFallbackEncoding);
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (2)
62globalOptions = new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => SyntaxTreeCategorizedAnalyzerConfigOptions.Create(analyzerConfigOptionsProvider.GlobalOptions)); 70perTreeOptionsBuilder.Add(tree, new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => Create(tree, analyzerConfigOptionsProvider)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
31_lazyNamingStylePreferences = new Lazy<NamingStylePreferences>(() => EditorConfigNamingStyleParser.ParseDictionary(_options));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigFile.cs (1)
23private readonly Lazy<ImmutableArray<Section>> _sections = new(() => Options.SelectAsArray(x => x.Section).Distinct());
Microsoft.CodeAnalysis.PublicApiAnalyzers (6)
DeclarePublicApiAnalyzer.Impl.cs (1)
95_apiMap = new Lazy<IReadOnlyDictionary<string, ApiLine>>(() => CreateApiMap(shippedData, unshippedData));
src\Compilers\Core\Portable\EncodedStringText.cs (1)
26private static readonly Lazy<Encoding> s_fallbackEncoding = new(CreateFallbackEncoding);
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (2)
62globalOptions = new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => SyntaxTreeCategorizedAnalyzerConfigOptions.Create(analyzerConfigOptionsProvider.GlobalOptions)); 70perTreeOptionsBuilder.Add(tree, new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => Create(tree, analyzerConfigOptionsProvider)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
31_lazyNamingStylePreferences = new Lazy<NamingStylePreferences>(() => EditorConfigNamingStyleParser.ParseDictionary(_options));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigFile.cs (1)
23private readonly Lazy<ImmutableArray<Section>> _sections = new(() => Options.SelectAsArray(x => x.Section).Distinct());
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Host\RemoteWorkspaceManager.cs (1)
48private static readonly Lazy<RemoteWorkspaceManager> s_default = new(static () =>
Microsoft.CodeAnalysis.ResxSourceGenerator (5)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
26private static readonly Lazy<Encoding> s_fallbackEncoding = new(CreateFallbackEncoding);
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (2)
62globalOptions = new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => SyntaxTreeCategorizedAnalyzerConfigOptions.Create(analyzerConfigOptionsProvider.GlobalOptions)); 70perTreeOptionsBuilder.Add(tree, new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => Create(tree, analyzerConfigOptionsProvider)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
31_lazyNamingStylePreferences = new Lazy<NamingStylePreferences>(() => EditorConfigNamingStyleParser.ParseDictionary(_options));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigFile.cs (1)
23private readonly Lazy<ImmutableArray<Section>> _sections = new(() => Options.SelectAsArray(x => x.Section).Distinct());
Microsoft.CodeAnalysis.Test.Utilities (3)
Assert\ConditionalFactAttribute.cs (1)
171private static readonly Lazy<bool> s_operatingSystemRestrictsFileNames = new Lazy<bool>(() =>
Assert\UseCultureAttribute.cs (2)
58_culture = new Lazy<CultureInfo>(() => new CultureInfo(culture, useUserOverride: false)); 59_uiCulture = new Lazy<CultureInfo>(() => new CultureInfo(uiCulture, useUserOverride: false));
Microsoft.CodeAnalysis.UnitTests (1)
Text\StringTextDecodingTests.cs (1)
51return EncodedStringText.TestAccessor.Create(stream, new Lazy<Encoding>(getEncoding), readEncodingOpt, algorithm, canBeEmbedded: false);
Microsoft.CodeAnalysis.Workspaces (20)
Diagnostics\DocumentAnalysisScope.cs (1)
35_lazyAdditionalFile = new Lazy<AdditionalText>(ComputeAdditionalFile);
FindSymbols\TopLevelSyntaxTree\TopLevelSyntaxTreeIndex.cs (1)
30_declaredSymbolInfoSet = new(() => [.. this.DeclaredSymbolInfos]);
Log\FunctionIdExtensions.cs (1)
13private static readonly Lazy<ImmutableDictionary<FunctionId, string>> s_functionIdsToString = new(
Options\GlobalOptionService.cs (1)
28private readonly Lazy<ImmutableArray<IOptionPersister>> _optionPersisters = new(() => GetOptionPersisters(optionPersisterProviders));
Serialization\SerializerService.cs (1)
43private readonly Lazy<TemporaryStorageService> _storageService = new(() => (TemporaryStorageService)workspaceServices.GetRequiredService<ITemporaryStorageServiceInternal>());
src\Compilers\Core\Portable\EncodedStringText.cs (1)
26private static readonly Lazy<Encoding> s_fallbackEncoding = new(CreateFallbackEncoding);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
31_lazyNamingStylePreferences = new Lazy<NamingStylePreferences>(() => EditorConfigNamingStyleParser.ParseDictionary(_options));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigFile.cs (1)
23private readonly Lazy<ImmutableArray<Section>> _sections = new(() => Options.SelectAsArray(x => x.Section).Distinct());
Storage\SQLite\v2\SQLitePersistentStorageService.cs (1)
39private static readonly Lazy<bool> s_initialized = new(TryInitializeLibrariesLazy);
Workspace\Host\Mef\MefHostServices.cs (1)
59=> compositionContext.GetExports<TExtension>().Select(e => new Lazy<TExtension>(() => e));
Workspace\Host\Metadata\IAnalyzerAssemblyLoaderProvider.cs (1)
46_shadowCopyLoader = new(CreateNewShadowCopyLoader);
Workspace\ProjectSystem\FileWatchedPortableExecutableReferenceFactory.cs (1)
67_fileReferenceChangeContext = new Lazy<IFileChangeContext>(() =>
Workspace\Solution\ProjectState.AnalyzerConfigOptionsCache.cs (1)
28private readonly Lazy<AnalyzerConfigData> _global = new(() => new AnalyzerConfigData(configSet.GlobalConfigOptions, StructuredAnalyzerConfigOptions.Empty));
Workspace\Solution\SolutionCompilationState.CompilationTracker.CompilationTrackerState.cs (1)
118new Lazy<Compilation>(() => compilationWithoutGeneratedDocuments),
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (3)
152FinalCompilationTrackerState finalState => (new Lazy<Compilation>(() => finalState.CompilationWithoutGeneratedDocuments), new CancellableLazy<Compilation?>(finalState.FinalCompilationWithGeneratedDocuments)), 346new Lazy<Compilation>(CreateEmptyCompilation), 801var lazyCompilationWithoutGeneratedDocuments = new Lazy<Compilation>(() =>
Workspace\Solution\SolutionState.cs (1)
111=> new(() => new HostDiagnosticAnalyzers(analyzerReferences));
Workspace\Solution\SourceGeneratedDocumentState.cs (2)
77var lazyTextChecksum = new Lazy<Checksum>(() => originalSourceTextChecksum ?? ComputeContentHash(generatedSourceText)); 241var lazyTextChecksum = new Lazy<Checksum>(() => ComputeContentHash(sourceText));
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (3)
MEF\TestComposition.cs (1)
84_exportProviderFactory = new Lazy<IExportProviderFactory>(GetOrCreateFactory);
Remote\InProcRemoteHostClientProvider.cs (2)
78_lazyManager = new Lazy<WorkspaceManager>( 84_lazyClient = new Lazy<RemoteHostClient>(
Microsoft.CommonLanguageServerProtocol.Framework.Package (6)
AbstractLanguageServer.cs (3)
74_lspServices = new Lazy<ILspServices>(() => ConstructLspServices()); 75_queue = new Lazy<IRequestExecutionQueue<TRequestContext>>(() => ConstructRequestExecutionQueue()); 76_handlerProvider = new Lazy<AbstractHandlerProvider>(() =>
HandlerProvider.cs (2)
100return new(() => instance); 105return new(() =>
RequestExecutionQueue.cs (1)
106languages.Add(metadata.Language, new(() =>
Microsoft.DotNet.Deployment.Tasks.Links (2)
Microsoft.DotNet.Helix.Sdk (1)
CommandPayload.cs (1)
17private readonly Lazy<DirectoryInfo> _directoryInfo = new Lazy<DirectoryInfo>(CreateDirectory);
Microsoft.DotNet.XUnitExtensions (13)
src\Microsoft.DotNet.XUnitExtensions.Shared\DiscovererHelpers.cs (1)
15private static readonly Lazy<bool> s_isMonoRuntime = new Lazy<bool>(() => Type.GetType("Mono.RuntimeStructs") != null);
src\Microsoft.DotNet.XUnitExtensions.Shared\Discoverers\SkipOnCoreClrDiscoverer.cs (12)
17private static readonly Lazy<bool> s_isJitStress = new Lazy<bool>(() => CoreClrConfigurationDetection.IsJitStress); 18private static readonly Lazy<bool> s_isJitStressRegs = new Lazy<bool>(() => CoreClrConfigurationDetection.IsJitStressRegs); 19private static readonly Lazy<bool> s_isJitMinOpts = new Lazy<bool>(() => CoreClrConfigurationDetection.IsJitMinOpts); 20private static readonly Lazy<bool> s_isTailCallStress = new Lazy<bool>(() => CoreClrConfigurationDetection.IsTailCallStress); 21private static readonly Lazy<bool> s_isZapDisable = new Lazy<bool>(() => CoreClrConfigurationDetection.IsZapDisable); 22private static readonly Lazy<bool> s_isGCStress3 = new Lazy<bool>(() => CoreClrConfigurationDetection.IsGCStress3); 23private static readonly Lazy<bool> s_isGCStressC = new Lazy<bool>(() => CoreClrConfigurationDetection.IsGCStressC); 24private static readonly Lazy<bool> s_isCheckedRuntime = new Lazy<bool>(() => CoreClrConfigurationDetection.IsCheckedRuntime); 25private static readonly Lazy<bool> s_isReleaseRuntime = new Lazy<bool>(() => CoreClrConfigurationDetection.IsReleaseRuntime); 26private static readonly Lazy<bool> s_isDebugRuntime = new Lazy<bool>(() => CoreClrConfigurationDetection.IsDebugRuntime); 27private static readonly Lazy<bool> s_isStressTest = new Lazy<bool>(() => CoreClrConfigurationDetection.IsStressTest); 28private static readonly Lazy<bool> s_isCoreClrInterpreter = new Lazy<bool>(() => CoreClrConfigurationDetection.IsCoreClrInterpreter);
Microsoft.DotNet.XUnitV3Extensions (13)
src\Microsoft.DotNet.XUnitExtensions.Shared\Attributes\SkipOnCoreClrAttribute.cs (12)
18private static readonly Lazy<bool> s_isJitStress = new Lazy<bool>(() => CoreClrConfigurationDetection.IsJitStress); 19private static readonly Lazy<bool> s_isJitStressRegs = new Lazy<bool>(() => CoreClrConfigurationDetection.IsJitStressRegs); 20private static readonly Lazy<bool> s_isJitMinOpts = new Lazy<bool>(() => CoreClrConfigurationDetection.IsJitMinOpts); 21private static readonly Lazy<bool> s_isTailCallStress = new Lazy<bool>(() => CoreClrConfigurationDetection.IsTailCallStress); 22private static readonly Lazy<bool> s_isZapDisable = new Lazy<bool>(() => CoreClrConfigurationDetection.IsZapDisable); 23private static readonly Lazy<bool> s_isGCStress3 = new Lazy<bool>(() => CoreClrConfigurationDetection.IsGCStress3); 24private static readonly Lazy<bool> s_isGCStressC = new Lazy<bool>(() => CoreClrConfigurationDetection.IsGCStressC); 25private static readonly Lazy<bool> s_isCheckedRuntime = new Lazy<bool>(() => CoreClrConfigurationDetection.IsCheckedRuntime); 26private static readonly Lazy<bool> s_isReleaseRuntime = new Lazy<bool>(() => CoreClrConfigurationDetection.IsReleaseRuntime); 27private static readonly Lazy<bool> s_isDebugRuntime = new Lazy<bool>(() => CoreClrConfigurationDetection.IsDebugRuntime); 28private static readonly Lazy<bool> s_isStressTest = new Lazy<bool>(() => CoreClrConfigurationDetection.IsStressTest); 29private static readonly Lazy<bool> s_isCoreClrInterpreter = new Lazy<bool>(() => CoreClrConfigurationDetection.IsCoreClrInterpreter);
src\Microsoft.DotNet.XUnitExtensions.Shared\DiscovererHelpers.cs (1)
15private static readonly Lazy<bool> s_isMonoRuntime = new Lazy<bool>(() => Type.GetType("Mono.RuntimeStructs") != null);
Microsoft.Extensions.DataIngestion.Tests (1)
Readers\MarkItDownConditionAttribute.cs (1)
18internal static readonly Lazy<bool> IsInstalled = new(CanInvokeMarkItDown);
Microsoft.Extensions.DependencyModel (1)
DependencyContext.cs (1)
17private static readonly Lazy<DependencyContext?> _defaultContext = new(LoadDefault);
Microsoft.Extensions.Options (2)
OptionsCache.cs (2)
39value = _cache.GetOrAdd(name, static (name, createOptions) => new Lazy<TOptions>(createOptions), createOptions); 68static (name, arg) => new Lazy<TOptions>(() => arg.createOptions(name, arg.factoryArgument)), (createOptions, factoryArgument)).Value;
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (1)
Resolver\LoopbackDnsTestBase.cs (1)
37_resolverLazy = new(InitializeResolver);
Microsoft.Extensions.Telemetry (2)
src\Shared\Memoization\MemoizedFunction.cs (2)
82return _values.GetOrAdd(arg, new Lazy<TResult>(() => _function(arg1))).Value; 155return _values.GetOrAdd(args, new Lazy<TResult>(() => _function(arg1, arg2))).Value;
Microsoft.Maui (3)
Hosting\MauiAppBuilder.cs (1)
26 var configuration = new Lazy<ConfigurationManager>(() => new ConfigurationManager());
MauiContext.cs (1)
31 _handlers = new Lazy<IMauiHandlersFactory>(() => _services.GetRequiredService<IMauiHandlersFactory>());
VisualDiagnostics\VisualDiagnostics.cs (1)
16 static Lazy<bool> isVisualDiagnosticsEnvVarSet = new Lazy<bool>(() => Environment.GetEnvironmentVariable("ENABLE_XAML_DIAGNOSTICS_SOURCE_INFO") is { } value && value == "1");
Microsoft.Maui.Controls (47)
ActivityIndicator\ActivityIndicator.cs (1)
24 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<ActivityIndicator>>(() => new PlatformConfigurationRegistry<ActivityIndicator>(this));
Application\Application.cs (2)
44 _systemResources = new Lazy<IResourceDictionary?>(() => 55 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<Application>>(() => new PlatformConfigurationRegistry<Application>(this));
BoxView\BoxView.cs (1)
23 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<BoxView>>(() => new PlatformConfigurationRegistry<BoxView>(this));
Button\Button.cs (1)
355 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<Button>>(() => new PlatformConfigurationRegistry<Button>(this));
CarouselPage\CarouselPage.cs (1)
14 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<CarouselPage>>(() => new PlatformConfigurationRegistry<CarouselPage>(this));
Cells\Cell.cs (2)
32 _elementConfiguration = new Lazy<ElementConfiguration>(() => new ElementConfiguration(this)); 351 new Lazy<PlatformConfigurationRegistry<Cell>>(() => new PlatformConfigurationRegistry<Cell>(cell));
CheckBox\CheckBox.cs (1)
37 public CheckBox() => _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<CheckBox>>(() => new PlatformConfigurationRegistry<CheckBox>(this));
DatePicker\DatePicker.cs (1)
53 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<DatePicker>>(() => new PlatformConfigurationRegistry<DatePicker>(this));
Editor\Editor.cs (1)
100 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<Editor>>(() => new PlatformConfigurationRegistry<Editor>(this));
Entry\Entry.cs (1)
95 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<Entry>>(() => new PlatformConfigurationRegistry<Entry>(this));
FlyoutPage\FlyoutPage.cs (1)
312 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<FlyoutPage>>(() => new PlatformConfigurationRegistry<FlyoutPage>(this));
Frame\Frame.cs (1)
28 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<Frame>>(() => new PlatformConfigurationRegistry<Frame>(this));
Image\Image.cs (1)
35 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<Image>>(() => new PlatformConfigurationRegistry<Image>(this));
ImageButton\ImageButton.cs (1)
65 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<ImageButton>>(() => new PlatformConfigurationRegistry<ImageButton>(this));
Label\Label.cs (1)
123 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<Label>>(() => new PlatformConfigurationRegistry<Label>(this));
LegacyLayouts\AbsoluteLayout.cs (2)
30 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<AbsoluteLayout>>(() => 166 var sizeRequest = new Lazy<SizeRequest>(() => view.Measure(double.PositiveInfinity, double.PositiveInfinity, MeasureFlags.IncludeMargins));
LegacyLayouts\Grid.cs (1)
75 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<Grid>>(() =>
LegacyLayouts\RelativeLayout.cs (1)
47 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<RelativeLayout>>(() =>
LegacyLayouts\StackLayout.cs (1)
27 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<StackLayout>>(() =>
ListView\ListView.cs (1)
113 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<ListView>>(() => new PlatformConfigurationRegistry<ListView>(this));
NavigationPage\NavigationPage.cs (2)
79 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<NavigationPage>>(() => new PlatformConfigurationRegistry<NavigationPage>(this)); 725 _castingList = new Lazy<ReadOnlyCastingList<Page, Element>>(() => new ReadOnlyCastingList<Page, Element>(Owner.InternalChildren));
NavigationPage\NavigationPage.Legacy.cs (1)
263 _castingList = new Lazy<ReadOnlyCastingList<Page, Element>>(() => new ReadOnlyCastingList<Page, Element>(Owner.InternalChildren));
NavigationProxy.cs (4)
25 Lazy<NavigatingStepRequestList> _modalStack = new Lazy<NavigatingStepRequestList>(() => new NavigatingStepRequestList()); 27 Lazy<List<Page>> _pushStack = new Lazy<List<Page>>(() => new List<Page>()); 43 _pushStack = new Lazy<List<Page>>(() => new List<Page>()); 44 _modalStack = new Lazy<NavigatingStepRequestList>(() => new NavigatingStepRequestList());
Page\Page.cs (1)
101 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<Page>>(() => new PlatformConfigurationRegistry<Page>(this));
Picker\Picker.cs (1)
74 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<Picker>>(() => new PlatformConfigurationRegistry<Picker>(this));
ProgressBar\ProgressBar.cs (1)
26 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<ProgressBar>>(() => new PlatformConfigurationRegistry<ProgressBar>(this));
RadioButton\RadioButton.cs (1)
213 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<RadioButton>>(() =>
RefreshView\RefreshView.cs (1)
28 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<RefreshView>>(() => new PlatformConfigurationRegistry<RefreshView>(this));
Registrar.cs (1)
317 static readonly Lazy<Dictionary<string, IList<StylePropertyAttribute>>> LazyStyleProperties = new Lazy<Dictionary<string, IList<StylePropertyAttribute>>>(LoadStyleSheets);
ScrollView\ScrollView.cs (1)
236 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<ScrollView>>(() => new PlatformConfigurationRegistry<ScrollView>(this));
SearchBar\SearchBar.cs (1)
115 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<SearchBar>>(() => new PlatformConfigurationRegistry<SearchBar>(this));
Shell\ShellItem.cs (1)
179 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<ShellItem>>(() => new PlatformConfigurationRegistry<ShellItem>(this));
Slider\Slider.cs (1)
63 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<Slider>>(() => new PlatformConfigurationRegistry<Slider>(this));
Stepper\Stepper.cs (1)
56 public Stepper() => _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<Stepper>>(() => new PlatformConfigurationRegistry<Stepper>(this));
SwipeView\SwipeView.cs (1)
21 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<SwipeView>>(() => new PlatformConfigurationRegistry<SwipeView>(this));
Switch\Switch.cs (1)
56 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<Switch>>(() => new PlatformConfigurationRegistry<Switch>(this));
TabbedPage\TabbedPage.cs (1)
74 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<TabbedPage>>(() => new PlatformConfigurationRegistry<TabbedPage>(this));
TableView\TableView.cs (1)
44 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<TableView>>(() => new PlatformConfigurationRegistry<TableView>(this));
TimePicker\TimePicker.cs (1)
48 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<TimePicker>>(() => new PlatformConfigurationRegistry<TimePicker>(this));
WebView\WebView.cs (1)
61 _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<WebView>>(() => new PlatformConfigurationRegistry<WebView>(this));
Microsoft.Maui.Controls.DesignTools (2)
ColorDesignTypeConverter.cs (2)
180 static readonly Lazy<Regex> RxColorHex = new(() => new Regex(RxColorHexPattern, RegexOptions.Compiled | RegexOptions.Singleline)); 189 static readonly Lazy<Regex> RxFuncExpr = new(() => new Regex(RxFuncPattern, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline));
Microsoft.Maui.Controls.Foldable (3)
DualScreenInfo.cs (1)
54 static Lazy<DualScreenInfo> _dualScreenInfo { get; } = new Lazy<DualScreenInfo>(OnCreate);
NoPlatformFoldableService.cs (1)
18 static Lazy<NoPlatformFoldableService> _Instance = new Lazy<NoPlatformFoldableService>(() => new NoPlatformFoldableService());
TwoPaneViewLayoutGuide.cs (1)
17 static Lazy<TwoPaneViewLayoutGuide> _twoPaneViewLayoutGuide = new Lazy<TwoPaneViewLayoutGuide>(() => new TwoPaneViewLayoutGuide());
Microsoft.Maui.Resizetizer (1)
ColorTable.cs (1)
13 static readonly Lazy<Dictionary<string, SKColor>> ColorConstants = new Lazy<Dictionary<string, SKColor>>(GetColors);
Microsoft.ML.AutoML (2)
ColumnInference\PurposeInference.cs (2)
73_type = new Lazy<DataViewType>(() => _data.Schema[_columnId].Type); 74_columnName = new Lazy<string>(() => _data.Schema[_columnId].Name);
Microsoft.ML.Data (1)
Transforms\RowToRowTransformerBase.cs (1)
71OutputColumns = new Lazy<DataViewSchema.DetachedColumn[]>(GetOutputColumnsCore);
Microsoft.ML.FastTree (3)
Dataset\SegmentIntArray.cs (2)
52public static Lazy<PerformSegmentFindOptimalCost> SegmentFindOptimalCost = new(() => 64public static Lazy<PerformSegmentFindOptimalPath> SegmentFindOptimalPath = new(() =>
Training\Test.cs (1)
475_winLossCalculator = new Lazy<WinLossCalculator>(
Microsoft.VisualStudio.LanguageServices (9)
FindReferences\StreamingFindUsagesPresenter.cs (1)
124_lazyClassificationFormatMap = new Lazy<IClassificationFormatMap>(() =>
LanguageService\AbstractLanguageService`2.cs (1)
56this._languageDebugInfo = new Lazy<VsLanguageDebugInfo>(CreateLanguageDebugInfo);
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager.cs (1)
59_libraryService = new Lazy<ILibraryService>(() => Workspace.Services.GetLanguageServices(_languageName).GetService<ILibraryService>());
NavigateTo\VisualStudioNavigateToPreviewServiceFactory.cs (1)
17new(() => new VisualStudioNavigateToPreviewService());
Options\VisualStudioOptionPersisterProvider.cs (1)
45_lazyPersister = new Lazy<IOptionPersister>(() => CreatePersister());
ProjectSystem\MetadataReferences\VisualStudioMetadataReferenceProviderServiceFactory.cs (1)
26private readonly Lazy<VisualStudioMetadataReferenceManager> _manager = new(
ProjectSystem\MiscellaneousFilesWorkspace.cs (1)
68_metadataReferences = new(() => [.. CreateMetadataReferences()]);
ProjectSystem\OpenTextBufferProvider.cs (1)
64_runningDocumentTable = new(() =>
ProjectSystem\SdkAnalyzerAssemblyRedirector.cs (1)
61_analyzerMap = new(() => CreateAnalyzerMap(insertedAnalyzersDirectory));
Microsoft.VisualStudio.LanguageServices.CSharp (2)
SemanticSearch\SemanticSearchToolWindowImpl.cs (2)
75private static readonly Lazy<ControlTemplate> s_buttonTemplate = new(CreateButtonTemplate); 81= new(() => new SemanticSearchEditorWorkspace(
Microsoft.VisualStudio.LanguageServices.Implementation (1)
ProjectSystem\CPS\CPSProject_IWorkspaceProjectContext.cs (1)
76_externalErrorReporter = new Lazy<ProjectExternalErrorReporter?>(() =>
MinimalValidationSample (1)
artifacts\obj\MinimalValidationSample\Release\net11.0\generated\Microsoft.Extensions.Validation.ValidationsGenerator\Microsoft.Extensions.Validation.ValidationsGenerator\ValidatableInfoResolver.g.cs (1)
193private static readonly global::System.Lazy<global::System.Collections.Concurrent.ConcurrentDictionary<global::System.Type, global::System.ComponentModel.DataAnnotations.ValidationAttribute[]>> _lazyTypeCache = new (() => new ());
MSBuild (9)
DebugUtils.cs (1)
160private static readonly Lazy<NodeMode?> ProcessNodeMode = new(
FrameworkLocationHelper.cs (3)
237private static readonly Lazy<VisualStudioSpec[]> VisualStudioSpecs = new(() => 433private static readonly Lazy<IReadOnlyDictionary<Version, DotNetFrameworkSpec>> DotNetFrameworkSpecDict = new(() => DotNetFrameworkSpecs().ToDictionary(spec => spec.Version)); 434private static readonly Lazy<IReadOnlyDictionary<Version, VisualStudioSpec>> VisualStudioSpecDict = new(() => VisualStudioSpecs.Value.ToDictionary(spec => spec.Version));
PrintLineDebugger.cs (3)
25private static readonly Lazy<PropertyInfo> CommonWriterProperty = new Lazy<PropertyInfo>( 38new Lazy<PrintLineDebugger>(() => Create(null, null, false)); 41new Lazy<PrintLineDebugger>(() => Create(null, null, true));
PrintLineDebuggerWriters.cs (1)
71private static readonly Lazy<string> _artifactsLogs = new Lazy<string>(
TypeLoader.cs (1)
84private static readonly Lazy<string[]> runtimeAssembliesCLR35_20 = new Lazy<string[]>(FindRuntimeAssembliesWithMicrosoftBuildFrameworkCLR2CLR35);
PresentationFramework (26)
MS\Internal\WindowsRuntime\Generated\Windows.Data.Text.cs (3)
46_defaultLazy = new Lazy<global::MS.Internal.WindowsRuntime.ABI.Windows.Data.Text.IAlternateWordForm>(() => ifc); 264_defaultLazy = new Lazy<global::MS.Internal.WindowsRuntime.ABI.Windows.Data.Text.IWordSegment>(() => ifc); 369_defaultLazy = new Lazy<global::MS.Internal.WindowsRuntime.ABI.Windows.Data.Text.IWordsSegmenter>(() => ifc);
MS\Internal\WindowsRuntime\Generated\Windows.Globalization.cs (1)
141_defaultLazy = new Lazy<global::MS.Internal.WindowsRuntime.ABI.Windows.Globalization.ILanguage>(() => ifc);
System\Windows\Markup\Baml2006\Baml2006SchemaContext.cs (9)
661= new Lazy<XamlMember>(() => XamlLanguage.Static.GetMember("MemberType")); 664= new Lazy<XamlMember>(() => XamlLanguage.Static.GetMember("Type")); 667= new Lazy<XamlMember>(() => _resourceDictionaryType.Value.GetMember("DeferrableContent")); 670= new Lazy<XamlType>(() => System.Windows.Markup.XamlReader.BamlSharedSchemaContext.GetXamlType(typeof(ResourceDictionary))); 673= new Lazy<XamlType>(() => System.Windows.Markup.XamlReader.BamlSharedSchemaContext.GetXamlType(typeof(EventSetter))); 676= new Lazy<XamlMember>(() => _eventSetterType.Value.GetMember("Event")); 679= new Lazy<XamlMember>(() => _eventSetterType.Value.GetMember("Handler")); 682= new Lazy<XamlMember>(() => System.Windows.Markup.XamlReader.BamlSharedSchemaContext.GetXamlType(typeof(FrameworkTemplate)).GetMember("Template")); 685= new Lazy<XamlType>(() => System.Windows.Markup.XamlReader.BamlSharedSchemaContext.GetXamlType(typeof(StaticResourceExtension)));
System\Windows\Markup\Baml2006\WpfSharedBamlSchemaContext.cs (9)
350= new Lazy<XamlMember>(() => XamlLanguage.Static.GetMember("MemberType")); 353= new Lazy<XamlMember>(() => XamlLanguage.Static.GetMember("Type")); 356= new Lazy<XamlMember>(() => _resourceDictionaryType.Value.GetMember("DeferrableContent")); 359= new Lazy<XamlType>(() => System.Windows.Markup.XamlReader.BamlSharedSchemaContext.GetXamlType(typeof(ResourceDictionary))); 362= new Lazy<XamlType>(() => System.Windows.Markup.XamlReader.BamlSharedSchemaContext.GetXamlType(typeof(EventSetter))); 365= new Lazy<XamlMember>(() => _eventSetterType.Value.GetMember("Event")); 368= new Lazy<XamlMember>(() => _eventSetterType.Value.GetMember("Handler")); 371= new Lazy<XamlMember>(() => System.Windows.Markup.XamlReader.BamlSharedSchemaContext.GetXamlType(typeof(FrameworkTemplate)).GetMember("Template")); 374= new Lazy<XamlType>(() => System.Windows.Markup.XamlReader.BamlSharedSchemaContext.GetXamlType(typeof(StaticResourceExtension)));
System\Windows\Markup\WpfXamlLoader.cs (1)
17private static Lazy<XamlMember> XmlSpace = new Lazy<XamlMember>(() => new WpfXamlMember(XmlAttributeProperties.XmlSpaceProperty, true));
System\Windows\Markup\XamlReader.cs (3)
1173new Lazy<WpfSharedBamlSchemaContext>(() => CreateBamlSchemaContext()); 1175new Lazy<WpfSharedXamlSchemaContext>(() => CreateXamlSchemaContext(false)); 1177new Lazy<WpfSharedXamlSchemaContext>(() => CreateXamlSchemaContext(true));
Roslyn.Diagnostics.Analyzers (5)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
26private static readonly Lazy<Encoding> s_fallbackEncoding = new(CreateFallbackEncoding);
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (2)
62globalOptions = new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => SyntaxTreeCategorizedAnalyzerConfigOptions.Create(analyzerConfigOptionsProvider.GlobalOptions)); 70perTreeOptionsBuilder.Add(tree, new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => Create(tree, analyzerConfigOptionsProvider)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
31_lazyNamingStylePreferences = new Lazy<NamingStylePreferences>(() => EditorConfigNamingStyleParser.ParseDictionary(_options));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigFile.cs (1)
23private readonly Lazy<ImmutableArray<Section>> _sections = new(() => Options.SelectAsArray(x => x.Section).Distinct());
Roslyn.Test.PdbUtilities (1)
EditAndContinue\EditAndContinueTest.GenerationVerifier.cs (1)
27private readonly Lazy<MetadataVisualizer> _lazyVisualizer = new(() => new MetadataVisualizer(readers, TextWriter.Null, MetadataVisualizerOptions.None));
Shared (2)
Memoization\MemoizedFunction.cs (2)
82return _values.GetOrAdd(arg, new Lazy<TResult>(() => _function(arg1))).Value; 155return _values.GetOrAdd(args, new Lazy<TResult>(() => _function(arg1, arg2))).Value;
Sockets.BindTests (2)
src\Servers\Kestrel\shared\test\TransportTestHelpers\IPv6ScopeIdPresentConditionAttribute.cs (1)
14private static readonly Lazy<bool> _ipv6ScopeIdPresent = new Lazy<bool>(IPv6ScopeIdAddressPresent);
src\Servers\Kestrel\shared\test\TransportTestHelpers\IPv6SupportedConditionAttribute.cs (1)
14private static readonly Lazy<bool> _ipv6Supported = new Lazy<bool>(CanBindToIPv6Address);
Sockets.FunctionalTests (2)
src\Servers\Kestrel\shared\test\TransportTestHelpers\IPv6ScopeIdPresentConditionAttribute.cs (1)
14private static readonly Lazy<bool> _ipv6ScopeIdPresent = new Lazy<bool>(IPv6ScopeIdAddressPresent);
src\Servers\Kestrel\shared\test\TransportTestHelpers\IPv6SupportedConditionAttribute.cs (1)
14private static readonly Lazy<bool> _ipv6Supported = new Lazy<bool>(CanBindToIPv6Address);
System.ComponentModel.Annotations (1)
System\ComponentModel\DataAnnotations\CustomValidationAttribute.cs (1)
92_malformedErrorMessage = new Lazy<string?>(CheckAttributeWellFormed);
System.ComponentModel.Composition (4)
System\ComponentModel\Composition\AttributedModel\AttributedModelDiscovery.cs (2)
82new Lazy<ParameterInfo>(() => parameter), 97new Lazy<ParameterInfo>(() => parameter),
System\ComponentModel\Composition\ReflectionModel\GenericSpecializationPartCreationInfo.cs (2)
337Lazy<ParameterInfo> parameter = new Lazy<ParameterInfo>(() => GetParameter(lazyParameter)); 402Lazy<IDictionary<string, object?>> lazyMetadata = new Lazy<IDictionary<string, object?>>(() => TranslateExportMetadata(capturedReflectionExport));
System.ComponentModel.TypeConverter (2)
src\libraries\Common\src\System\Drawing\ColorTable.cs (1)
12private static readonly Lazy<Dictionary<string, Color>> s_colorConstants = new Lazy<Dictionary<string, Color>>(GetColors);
System\Drawing\ColorConverter.cs (1)
17private static readonly Lazy<StandardValuesCollection> s_valuesLazy = new Lazy<StandardValuesCollection>(() =>
System.Composition.Hosting (1)
System\Composition\Hosting\Providers\Lazy\LazyExportDescriptorProvider.cs (1)
39return ExportDescriptor.Create((c, o) => new Lazy<TValue>(() => (TValue)CompositionOperation.Run(c, da)), dsc.Metadata);
System.Composition.TypedParts (1)
System\Composition\TypedParts\Discovery\DiscoveredPart.cs (1)
59_partMetadata = new Lazy<IDictionary<string, object>>(() => GetPartMetadata(partType));
System.Console (1)
System\ConsolePal.Unix.cs (1)
44private static readonly Lazy<TerminalFormatStrings> s_terminalFormatStringsInstance = new(() => new TerminalFormatStrings(TermInfo.DatabaseFactory.ReadActiveDatabase()));
System.Drawing.Primitives (1)
src\libraries\Common\src\System\Drawing\ColorTable.cs (1)
12private static readonly Lazy<Dictionary<string, Color>> s_colorConstants = new Lazy<Dictionary<string, Color>>(GetColors);
System.Formats.Tar (1)
System\Formats\Tar\TarHelpers.Unix.cs (1)
12private static readonly Lazy<UnixFileMode> s_umask = new Lazy<UnixFileMode>(DetermineUMask);
System.Net.Http (1)
System\Net\Http\SocketsHttpHandler\SystemProxyInfo.cs (1)
10private static readonly Lazy<IWebProxy> s_proxy = new Lazy<IWebProxy>(ConstructSystemProxy);
System.Net.Ping (3)
src\libraries\Common\src\System\Net\NetworkInformation\UnixCommandLinePing.cs (1)
21private static readonly Lazy<bool> s_isBusybox = new Lazy<bool>(() => IsBusyboxPing(s_discoveredPing4UtilityPath));
src\libraries\Common\src\System\Net\RawSocketPermissions.cs (2)
10private static readonly Lazy<bool> s_canUseRawIPv4Sockets = new Lazy<bool>(() => CheckRawSocketPermissions(AddressFamily.InterNetwork)); 11private static readonly Lazy<bool> s_canUseRawIPv6Sockets = new Lazy<bool>(() => CheckRawSocketPermissions(AddressFamily.InterNetworkV6));
System.Net.Quic (1)
System\Net\Quic\Internal\MsQuicApi.cs (1)
56private static readonly Lazy<MsQuicApi> _api = new Lazy<MsQuicApi>(AllocateMsQuicApi);
System.Net.Security (3)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (1)
34private static readonly Lazy<string[]> s_defaultSigAlgs = new(GetDefaultSignatureAlgorithms);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\GssSafeHandles.cs (1)
73private static readonly Lazy<bool> s_IsNtlmInstalled = new Lazy<bool>(InitIsNtlmInstalled);
System\Net\NegotiateAuthenticationPal.Unix.cs (1)
22private static readonly Lazy<bool> _hasSystemNetSecurityNative = new Lazy<bool>(CheckHasSystemNetSecurityNative);
System.Private.CoreLib (1)
src\libraries\System.Private.CoreLib\src\System\LazyOfTTMetadata.cs (1)
14base(valueFactory)
System.Private.Windows.Core.TestUtilities (2)
XUnit\UseCultureAttribute.cs (2)
47_culture = new Lazy<CultureInfo>(() => new(culture, useUserOverride: false)); 48_uiCulture = new Lazy<CultureInfo>(() => new(uiCulture, useUserOverride: false));
System.Private.Xml (1)
System\Xml\Serialization\SourceInfo.cs (1)
25private static readonly Lazy<MethodInfo> s_iListGetItemMethod = new Lazy<MethodInfo>(
System.Reflection.Metadata (1)
System\Reflection\PortableExecutable\PEBuilder.cs (1)
71_lazySections = new Lazy<ImmutableArray<Section>>(CreateSections);
System.Security.Cryptography (10)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSslAvailable.cs (1)
15new Lazy<bool>(() => OpenSslAvailable() != 0);
src\libraries\Common\src\System\Security\Cryptography\DSAOpenSsl.cs (2)
47_key = new Lazy<SafeDsaHandle>(GenerateKey); 64_key = new Lazy<SafeDsaHandle>(GenerateKey);
src\libraries\Common\src\System\Security\Cryptography\ECDiffieHellmanOpenSsl.cs (1)
45_key = new Lazy<SafeEvpPKeyHandle>(() => ECOpenSsl.GenerateECKey(keySize));
src\libraries\Common\src\System\Security\Cryptography\ECDsaOpenSsl.cs (2)
63_key = new Lazy<SafeEvpPKeyHandle>(GenerateKeyFromSize); 245_key = new Lazy<SafeEvpPKeyHandle>(GenerateKeyFromSize);
src\libraries\Common\src\System\Security\Cryptography\ECOpenSsl.cs (1)
20_key = new Lazy<SafeEcKeyHandle>(() => GenerateKeyByKeySize(keySizeBits));
src\libraries\Common\src\System\Security\Cryptography\RSAOpenSsl.cs (2)
39_key = new Lazy<SafeEvpPKeyHandle>(GenerateKey); 56_key = new Lazy<SafeEvpPKeyHandle>(GenerateKey);
System\Security\Cryptography\X509Certificates\X500NameEncoder.cs (1)
33private static readonly Lazy<Dictionary<string, EncodingRules>> s_lazyEncodingRulesLookup = new(CreateEncodingRulesLookup);
System.ServiceModel.Primitives (1)
System\ServiceModel\Dispatcher\InvokerUtil.cs (1)
22private static readonly Lazy<bool> s_useLegacyInvokeDelegate = new Lazy<bool>(() =>
System.Threading.RateLimiting (1)
System\Threading\RateLimiting\DefaultPartitionedRateLimiter.cs (1)
97limiter = new Lazy<RateLimiter>(() => partition.Factory(partition.PartitionKey));
System.Windows.Forms.Primitives.TestUtilities (1)
PlatformDetection.cs (1)
29private static readonly Lazy<bool> s_largeArrayIsNotSupported = new(IsLargeArrayNotSupported);
System.Xaml (32)
System\Xaml\XamlLanguage.cs (32)
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))); 120new Lazy<ReadOnlyCollection<XamlType>>(GetAllTypes); 129new Lazy<XamlDirective>(() => GetXamlDirective(x_Class)); 131new Lazy<XamlDirective>(() => GetXamlDirective(x_ClassModifier)); 133new Lazy<XamlDirective>(() => GetXamlDirective(x_Code)); 141new Lazy<XamlDirective>(() => GetXamlDirective(x_FieldModifier)); 158new Lazy<XamlDirective>(() => GetXamlDirective(x_Name)); 167new Lazy<XamlDirective>(() => GetXamlDirective(x_SynchronousMode)); 169new Lazy<XamlDirective>(() => GetXamlDirective(x_TypeArguments)); 171new Lazy<XamlDirective>(() => GetXamlDirective(x_Uid)); 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 (5)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
26private static readonly Lazy<Encoding> s_fallbackEncoding = new(CreateFallbackEncoding);
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (2)
62globalOptions = new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => SyntaxTreeCategorizedAnalyzerConfigOptions.Create(analyzerConfigOptionsProvider.GlobalOptions)); 70perTreeOptionsBuilder.Add(tree, new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => Create(tree, analyzerConfigOptionsProvider)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
31_lazyNamingStylePreferences = new Lazy<NamingStylePreferences>(() => EditorConfigNamingStyleParser.ParseDictionary(_options));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigFile.cs (1)
23private readonly Lazy<ImmutableArray<Section>> _sections = new(() => Options.SelectAsArray(x => x.Section).Distinct());
Text.Analyzers (5)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
26private static readonly Lazy<Encoding> s_fallbackEncoding = new(CreateFallbackEncoding);
src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (2)
62globalOptions = new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => SyntaxTreeCategorizedAnalyzerConfigOptions.Create(analyzerConfigOptionsProvider.GlobalOptions)); 70perTreeOptionsBuilder.Add(tree, new Lazy<SyntaxTreeCategorizedAnalyzerConfigOptions>(() => Create(tree, analyzerConfigOptionsProvider)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
31_lazyNamingStylePreferences = new Lazy<NamingStylePreferences>(() => EditorConfigNamingStyleParser.ParseDictionary(_options));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigFile.cs (1)
23private readonly Lazy<ImmutableArray<Section>> _sections = new(() => Options.SelectAsArray(x => x.Section).Distinct());
xunit.assert (4)
Sdk\AssertEqualityComparer.cs (1)
156 this.innerComparer = new Lazy<IEqualityComparer>(() => innerComparer ?? AssertEqualityComparer<T>.DefaultInnerComparer);
Sdk\AssertHelper.cs (3)
70 static readonly Lazy<TypeInfo?> fileSystemInfoTypeInfo = new Lazy<TypeInfo?>(() => Type.GetType(fileSystemInfoFqn)?.GetTypeInfo()); 71 static readonly Lazy<PropertyInfo?> fileSystemInfoFullNameProperty = new Lazy<PropertyInfo?>(() => Type.GetType(fileSystemInfoFqn)?.GetTypeInfo().GetDeclaredProperty("FullName")); 79 static readonly Lazy<Assembly[]> getAssemblies = new Lazy<Assembly[]>(() =>
xunit.console (4)
common\AssemblyResolution\DependencyContextAssemblyCache.cs (1)
53fallbackRuntimeIdentifier = new Lazy<string>(() => GetFallbackRuntime(this.currentRuntimeIdentifier));
common\AssemblyResolution\Microsoft.DotNet.PlatformAbstractions\Native\PlatformApis.cs (2)
18private static readonly Lazy<Platform> _platform = new Lazy<Platform>(DetermineOSPlatform); 19private static readonly Lazy<DistroInfo> _distroInfo = new Lazy<DistroInfo>(LoadDistroInfo);
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\DependencyContext.cs (1)
13private static readonly Lazy<DependencyContext> _defaultContext = new Lazy<DependencyContext>(LoadDefault);