12 overrides of TryGetValue
Microsoft.CodeAnalysis (1)
DiagnosticAnalyzer\DictionaryAnalyzerConfigOptions.cs (1)
24public override bool TryGetValue(string key, [NotNullWhen(true)] out string? value)
Microsoft.CodeAnalysis.CodeStyle (2)
src\Compilers\Core\Portable\DiagnosticAnalyzer\DictionaryAnalyzerConfigOptions.cs (1)
24public override bool TryGetValue(string key, [NotNullWhen(true)] out string? value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
35public override bool TryGetValue(string key, [NotNullWhen(true)] out string? value)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
EditorConfigSettings\Updater\SettingsUpdaterTests.TestAnalyzerConfigOptions.cs (1)
27public override bool TryGetValue(string key, [NotNullWhen(true)] out string? value)
Microsoft.CodeAnalysis.EditorFeatures (1)
Options\EditorAnalyzerConfigOptions.cs (1)
23public override bool TryGetValue(string key, [NotNullWhen(true)] out string? value)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
EditorConfigSettings\Data\CodeStyleSettingsTest.cs (1)
106public override bool TryGetValue(string key, [NotNullWhen(true)] out string? value)
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
EditAndContinue\EditAndContinueTestAnalyzerConfigOptions.cs (1)
19public override bool TryGetValue(string key, [NotNullWhen(true)] out string? value)
Microsoft.CodeAnalysis.Workspaces (2)
src\Compilers\Core\Portable\DiagnosticAnalyzer\DictionaryAnalyzerConfigOptions.cs (1)
24public override bool TryGetValue(string key, [NotNullWhen(true)] out string? value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (1)
35public override bool TryGetValue(string key, [NotNullWhen(true)] out string? value)
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
GeneratorTests.cs (1)
195public override bool TryGetValue(string key, out string value)
Microsoft.Gen.MetricsReports.Unit.Tests (1)
GeneratorTests.cs (1)
185public override bool TryGetValue(string key, out string value)
System.Windows.Forms.Analyzers.CSharp.Tests (1)
CompilerAnalyzerConfigOptions.cs (1)
26public override bool TryGetValue(string key, [NotNullWhen(true)] out string? value) => _backing.TryGetValue(key, out value);
94 references to TryGetValue
BuildActionTelemetryTable (8)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (8)
101if (analyzerConfigOptions.TryGetValue(diagnosticKey, out var value) && 121if (analyzerConfigOptions.TryGetValue(categoryBasedKey, out value) && 129if (analyzerConfigOptions.TryGetValue(DotnetAnalyzerDiagnosticSeverityKey, out value) && 167if (analyzerConfigOptions.TryGetValue(diagnosticKey, out value) && 188if (analyzerConfigOptions.TryGetValue(categoryBasedKey, out value) && 196if (analyzerConfigOptions.TryGetValue(DotnetAnalyzerDiagnosticSeverityKey, out value) && 233if (analyzerOptions.TryGetValue(categoryBasedKey, out var value) && 241if (analyzerOptions.TryGetValue(DotnetAnalyzerDiagnosticSeverityKey, out value) &&
ILLink.RoslynAnalyzer (1)
AnalyzerOptionsExtensions.cs (1)
16 return options.AnalyzerConfigOptionsProvider.GlobalOptions.TryGetValue (
Microsoft.CodeAnalysis (3)
DiagnosticAnalyzer\AnalyzerOptionsExtensions.cs (2)
66if (analyzerConfigOptions.TryGetValue(categoryBasedKey, out var value) && 78if (analyzerConfigOptions.TryGetValue(DotnetAnalyzerDiagnosticSeverityKey, out value) &&
SourceGeneration\GeneratedCodeUtilities.cs (1)
166if (options.TryGetValue("generated_code", out string? optionValue) &&
Microsoft.CodeAnalysis.CodeStyle (21)
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (4)
202var hasAllBulkSeverityConfiguration = treeOptions.TryGetValue(allDiagnosticsBulkSeverityKey, out var editorConfigBulkSeverity) 203|| globalOptions.TryGetValue(allDiagnosticsBulkSeverityKey, out editorConfigBulkSeverity); 226if (treeOptions.TryGetValue(categoryConfigurationKey, out var editorConfigSeverity) 227|| globalOptions.TryGetValue(categoryConfigurationKey, out editorConfigSeverity))
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (2)
61context.Options.AnalyzerConfigOptionsProvider.GlobalOptions.TryGetValue(MatchFolderAndNamespaceConstants.RootNamespaceOption, out var rootNamespace); 64if (!context.Options.AnalyzerConfigOptionsProvider.GlobalOptions.TryGetValue(MatchFolderAndNamespaceConstants.ProjectDirOption, out var projectDir)
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
166if (options.TryGetValue("generated_code", out string? optionValue) &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (2)
36=> _options.TryGetValue(key, out value) || _fallback?.TryGetValue(key, out value) == true;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalyzerConfigOptionsExtensions.cs (3)
36if (analyzerConfigOptions.TryGetValue(option.Definition.ConfigName, out var stringValue)) 60return analyzerConfigOptions.TryGetValue(EnableCodeStyleSeverityKey, out var value) 70return analyzerConfigOptions.TryGetValue(AnalysisLevelKey, out var value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (8)
101if (analyzerConfigOptions.TryGetValue(diagnosticKey, out var value) && 121if (analyzerConfigOptions.TryGetValue(categoryBasedKey, out value) && 129if (analyzerConfigOptions.TryGetValue(DotnetAnalyzerDiagnosticSeverityKey, out value) && 167if (analyzerConfigOptions.TryGetValue(diagnosticKey, out value) && 188if (analyzerConfigOptions.TryGetValue(categoryBasedKey, out value) && 196if (analyzerConfigOptions.TryGetValue(DotnetAnalyzerDiagnosticSeverityKey, out value) && 233if (analyzerOptions.TryGetValue(categoryBasedKey, out var value) && 241if (analyzerOptions.TryGetValue(DotnetAnalyzerDiagnosticSeverityKey, out value) &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (1)
108trimmedDictionary[key.Trim()] = allRawConventions.TryGetValue(key, out var value) ? value : throw new InvalidOperationException();
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (17)
CommandLineTests.cs (17)
10398po.GlobalOptions.TryGetValue("a", out globalA); 10401ctx.RegisterSourceOutput(ctx.AnalyzerConfigOptionsProvider.Select((p, _) => { p.GlobalOptions.TryGetValue("a", out var value); return value; }), (spc, value) => 10408ctx.RegisterSourceOutput(ctx.AnalyzerConfigOptionsProvider.Combine(syntaxTreeInput).Select((p, _) => { p.Left.GetOptions(p.Right).TryGetValue("a", out var value); return value; }), (spc, value) => 14671Assert.True(globalOptions.TryGetValue("key1", out var keyValue)); 14673Assert.False(globalOptions.TryGetValue("key2", out _)); 14674Assert.False(globalOptions.TryGetValue("key3", out _)); 14675Assert.False(globalOptions.TryGetValue("key4", out _)); 14676Assert.False(globalOptions.TryGetValue("key5", out _)); 14677Assert.False(globalOptions.TryGetValue("key6", out _)); 14678Assert.False(globalOptions.TryGetValue("key7", out _)); 14682Assert.True(classOptions.TryGetValue("key1", out keyValue)); 14684Assert.False(classOptions.TryGetValue("key2", out _)); 14685Assert.False(classOptions.TryGetValue("key3", out _)); 14686Assert.True(classOptions.TryGetValue("key4", out keyValue)); 14688Assert.False(classOptions.TryGetValue("key5", out _)); 14689Assert.False(classOptions.TryGetValue("key6", out _)); 14690Assert.False(classOptions.TryGetValue("key7", out _));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (3)
SourceGeneration\GeneratorDriverTests.cs (3)
868Assert.True(passedIn!.GlobalOptions.TryGetValue("a", out var item1)); 871Assert.True(passedIn!.GlobalOptions.TryGetValue("b", out var item2)); 2622p.GlobalOptions.TryGetValue("test", out var analyzerOptionsValue);
Microsoft.CodeAnalysis.Features (6)
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (4)
202var hasAllBulkSeverityConfiguration = treeOptions.TryGetValue(allDiagnosticsBulkSeverityKey, out var editorConfigBulkSeverity) 203|| globalOptions.TryGetValue(allDiagnosticsBulkSeverityKey, out editorConfigBulkSeverity); 226if (treeOptions.TryGetValue(categoryConfigurationKey, out var editorConfigSeverity) 227|| globalOptions.TryGetValue(categoryConfigurationKey, out editorConfigSeverity))
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (2)
61context.Options.AnalyzerConfigOptionsProvider.GlobalOptions.TryGetValue(MatchFolderAndNamespaceConstants.RootNamespaceOption, out var rootNamespace); 64if (!context.Options.AnalyzerConfigOptionsProvider.GlobalOptions.TryGetValue(MatchFolderAndNamespaceConstants.ProjectDirOption, out var projectDir)
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
420if (context.AnalyzerConfigOptions.GetOptions(syntaxTree).TryGetValue("enc_generator_output", out var optionValue))
Microsoft.CodeAnalysis.Features.UnitTests (1)
EditAndContinue\CompileTimeSolutionProviderTests.cs (1)
86(o, ct) => o.GlobalOptions.TryGetValue("build_property.SuppressRazorSourceGenerator", out var value) && bool.Parse(value));
Microsoft.CodeAnalysis.Workspaces (17)
Options\DocumentOptionSet.cs (1)
80if (!_configOptions.TryGetValue(internallyDefinedOption.Definition.ConfigName, out var stringValue))
Serialization\SerializerService.cs (1)
184if (options.TryGetValue(key, out var value))
src\Compilers\Core\Portable\SourceGeneration\GeneratedCodeUtilities.cs (1)
166if (options.TryGetValue("generated_code", out string? optionValue) &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\StructuredAnalyzerConfigOptions.cs (2)
36=> _options.TryGetValue(key, out value) || _fallback?.TryGetValue(key, out value) == true;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalyzerConfigOptionsExtensions.cs (3)
36if (analyzerConfigOptions.TryGetValue(option.Definition.ConfigName, out var stringValue)) 60return analyzerConfigOptions.TryGetValue(EnableCodeStyleSeverityKey, out var value) 70return analyzerConfigOptions.TryGetValue(AnalysisLevelKey, out var value)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (8)
101if (analyzerConfigOptions.TryGetValue(diagnosticKey, out var value) && 121if (analyzerConfigOptions.TryGetValue(categoryBasedKey, out value) && 129if (analyzerConfigOptions.TryGetValue(DotnetAnalyzerDiagnosticSeverityKey, out value) && 167if (analyzerConfigOptions.TryGetValue(diagnosticKey, out value) && 188if (analyzerConfigOptions.TryGetValue(categoryBasedKey, out value) && 196if (analyzerConfigOptions.TryGetValue(DotnetAnalyzerDiagnosticSeverityKey, out value) && 233if (analyzerOptions.TryGetValue(categoryBasedKey, out var value) && 241if (analyzerOptions.TryGetValue(DotnetAnalyzerDiagnosticSeverityKey, out value) &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (1)
108trimmedDictionary[key.Trim()] = allRawConventions.TryGetValue(key, out var value) ? value : throw new InvalidOperationException();
Microsoft.Gen.ComplianceReports (2)
src\Generators\Shared\GeneratorUtilities.cs (2)
143_ = context.AnalyzerConfigOptions.GlobalOptions.TryGetValue(msBuildProperty, out var generateFiles); 149=> options.TryGetValue(name, out value) && !string.IsNullOrWhiteSpace(value);
Microsoft.Gen.ContextualOptions (2)
src\Generators\Shared\GeneratorUtilities.cs (2)
143_ = context.AnalyzerConfigOptions.GlobalOptions.TryGetValue(msBuildProperty, out var generateFiles); 149=> options.TryGetValue(name, out value) && !string.IsNullOrWhiteSpace(value);
Microsoft.Gen.Logging (2)
src\Generators\Shared\GeneratorUtilities.cs (2)
143_ = context.AnalyzerConfigOptions.GlobalOptions.TryGetValue(msBuildProperty, out var generateFiles); 149=> options.TryGetValue(name, out value) && !string.IsNullOrWhiteSpace(value);
Microsoft.Gen.Metrics (2)
src\Generators\Shared\GeneratorUtilities.cs (2)
143_ = context.AnalyzerConfigOptions.GlobalOptions.TryGetValue(msBuildProperty, out var generateFiles); 149=> options.TryGetValue(name, out value) && !string.IsNullOrWhiteSpace(value);
Microsoft.Gen.MetricsReports (3)
MetricsReportsGenerator.cs (1)
85_ = options.TryGetValue(RootNamespace, out var rootNamespace);
src\Generators\Shared\GeneratorUtilities.cs (2)
143_ = context.AnalyzerConfigOptions.GlobalOptions.TryGetValue(msBuildProperty, out var generateFiles); 149=> options.TryGetValue(name, out value) && !string.IsNullOrWhiteSpace(value);
Microsoft.Interop.ComInterfaceGenerator (2)
Analyzers\ComHostingDoesNotSupportGeneratedComInterfaceAnalyzer.cs (1)
25if (!context.Options.AnalyzerConfigOptionsProvider.GlobalOptions.TryGetValue("build_property.EnableComHosting", out string? enableComHosting)
Analyzers\RuntimeComApiUsageWithSourceGeneratedComAnalyzer.cs (1)
133bool enableGeneratedComInterfaceComImportInterop = context.Options.AnalyzerConfigOptionsProvider.GlobalOptions.TryGetValue("build_property.EnableGeneratedComInterfaceComImportInterop", out string enableSourceGeneratedBuiltInInteropOption)
Microsoft.Interop.LibraryImportGenerator (2)
Analyzers\ConvertToLibraryImportFixer.cs (1)
639if (options.TryGetValue("dotnet_style_prefer_collection_expression", out string? preferCollectionExpressionsRule))
LibraryImportGeneratorOptions.cs (1)
22return options.TryGetValue(key, out string? value)
System.Windows.Forms.Analyzers (1)
System\Windows\Forms\Analyzers\AnalyzerConfigOptionsProviderExtensions.cs (1)
19return analyzerConfigOptions.GlobalOptions.TryGetValue($"build_property.{name}", out value);