13 overrides of TryGetValue
Microsoft.CodeAnalysis (1)
DiagnosticAnalyzer\DictionaryAnalyzerConfigOptions.cs (1)
24public override bool TryGetValue(string key, [NotNullWhen(true)] out string? value)
Microsoft.CodeAnalysis.CodeStyle (3)
DictionaryAnalyzerConfigOptions.cs (1)
24public override bool TryGetValue(string key, [NotNullWhen(true)] out string? value)
StructuredAnalyzerConfigOptions.cs (2)
34public override bool TryGetValue(string key, [NotNullWhen(true)] out string? value) 49public 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 (2)
EditorConfigSettings\DataProvider\SettingsProviderBase.cs (1)
130public override bool TryGetValue(string key, [NotNullWhen(true)] out string? value)
Options\EditorAnalyzerConfigOptions.cs (1)
27public override bool TryGetValue(string key, [NotNullWhen(true)] out string? value)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
EditAndContinue\EditAndContinueTestAnalyzerConfigOptions.cs (1)
20public override bool TryGetValue(string key, [NotNullWhen(true)] out string? value)
EditorConfigSettings\Data\CodeStyleSettingsTest.cs (1)
106public override bool TryGetValue(string key, [NotNullWhen(true)] out string? value)
Microsoft.CodeAnalysis.Workspaces (4)
DictionaryAnalyzerConfigOptions.cs (1)
24public override bool TryGetValue(string key, [NotNullWhen(true)] out string? value)
StructuredAnalyzerConfigOptions.cs (2)
34public override bool TryGetValue(string key, [NotNullWhen(true)] out string? value) 49public override bool TryGetValue(string key, [NotNullWhen(true)] out string? value)
Workspace\Solution\ProjectState.cs (1)
402public override bool TryGetValue(string key, [NotNullWhen(true)] out string? value)
104 references to TryGetValue
BuildActionTelemetryTable (6)
DiagnosticDescriptorExtensions.cs (6)
62if (analyzerConfigOptions.TryGetValue(diagnosticKey, out var value) && 82if (analyzerConfigOptions.TryGetValue(categoryBasedKey, out value) && 90if (analyzerConfigOptions.TryGetValue(DotnetAnalyzerDiagnosticSeverityKey, out value) && 104if (analyzerConfigOptions.TryGetValue(diagnosticKey, out var value) && 124if (analyzerConfigOptions.TryGetValue(categoryBasedKey, out value) && 132if (analyzerConfigOptions.TryGetValue(DotnetAnalyzerDiagnosticSeverityKey, out value) &&
Microsoft.CodeAnalysis (3)
DiagnosticAnalyzer\AnalyzerOptionsExtensions.cs (2)
66if (analyzerConfigOptions.TryGetValue(categoryBasedKey, out var value) && 78if (analyzerConfigOptions.TryGetValue(DotnetAnalyzerDiagnosticSeverityKey, out value) &&
InternalUtilities\GeneratedCodeUtilities.cs (1)
166if (options.TryGetValue("generated_code", out string? optionValue) &&
Microsoft.CodeAnalysis.CodeStyle (12)
AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (2)
61context.Options.AnalyzerConfigOptionsProvider.GlobalOptions.TryGetValue(MatchFolderAndNamespaceConstants.RootNamespaceOption, out var rootNamespace); 64if (!context.Options.AnalyzerConfigOptionsProvider.GlobalOptions.TryGetValue(MatchFolderAndNamespaceConstants.ProjectDirOption, out var projectDir)
AnalyzerConfigOptionsExtensions.cs (1)
39if (analyzerConfigOptions.TryGetValue(option.Definition.ConfigName, out var stringValue))
DiagnosticDescriptorExtensions.cs (6)
62if (analyzerConfigOptions.TryGetValue(diagnosticKey, out var value) && 82if (analyzerConfigOptions.TryGetValue(categoryBasedKey, out value) && 90if (analyzerConfigOptions.TryGetValue(DotnetAnalyzerDiagnosticSeverityKey, out value) && 104if (analyzerConfigOptions.TryGetValue(diagnosticKey, out var value) && 124if (analyzerConfigOptions.TryGetValue(categoryBasedKey, out value) && 132if (analyzerConfigOptions.TryGetValue(DotnetAnalyzerDiagnosticSeverityKey, out value) &&
EditorConfigNamingStyleParser.cs (1)
108trimmedDictionary[key.Trim()] = allRawConventions.TryGetValue(key, out var value) ? value : throw new InvalidOperationException();
GeneratedCodeUtilities.cs (1)
166if (options.TryGetValue("generated_code", out string? optionValue) &&
StructuredAnalyzerConfigOptions.cs (1)
35=> _options.TryGetValue(key, out value);
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (53)
CommandLineTests.cs (53)
259Assert.True(options.TryGetValue("my_option", out string val)); 261Assert.False(options.TryGetValue("my_option2", out _)); 262Assert.False(options.TryGetValue("dotnet_diagnostic.cs0169.severity", out _)); 266Assert.True(options.TryGetValue("my_option2", out val)); 268Assert.False(options.TryGetValue("my_option", out _)); 269Assert.False(options.TryGetValue("dotnet_diagnostic.cs0169.severity", out _)); 10170po.GlobalOptions.TryGetValue("a", out globalA); 10173ctx.RegisterSourceOutput(ctx.AnalyzerConfigOptionsProvider.Select((p, _) => { p.GlobalOptions.TryGetValue("a", out var value); return value; }), (spc, value) => 10180ctx.RegisterSourceOutput(ctx.AnalyzerConfigOptionsProvider.Combine(syntaxTreeInput).Select((p, _) => { p.Left.GetOptions(p.Right).TryGetValue("a", out var value); return value; }), (spc, value) => 13789Assert.True(globalOptions.TryGetValue("key1", out var keyValue)); 13791Assert.False(globalOptions.TryGetValue("key2", out _)); 13792Assert.False(globalOptions.TryGetValue("key3", out _)); 13793Assert.False(globalOptions.TryGetValue("key4", out _)); 13794Assert.False(globalOptions.TryGetValue("key5", out _)); 13795Assert.False(globalOptions.TryGetValue("key6", out _)); 13796Assert.False(globalOptions.TryGetValue("key7", out _)); 13800Assert.True(classOptions.TryGetValue("key1", out keyValue)); 13802Assert.False(classOptions.TryGetValue("key2", out _)); 13803Assert.False(classOptions.TryGetValue("key3", out _)); 13804Assert.True(classOptions.TryGetValue("key4", out keyValue)); 13806Assert.False(classOptions.TryGetValue("key5", out _)); 13807Assert.False(classOptions.TryGetValue("key6", out _)); 13808Assert.False(classOptions.TryGetValue("key7", out _)); 13829Assert.True(globalOptions.TryGetValue("key1", out var keyValue)); 13831Assert.False(globalOptions.TryGetValue("key2", out _)); 13832Assert.False(globalOptions.TryGetValue("key3", out _)); 13833Assert.False(globalOptions.TryGetValue("key4", out _)); 13834Assert.False(globalOptions.TryGetValue("key5", out _)); 13835Assert.False(globalOptions.TryGetValue("key6", out _)); 13836Assert.False(globalOptions.TryGetValue("key7", out _)); 13840Assert.True(classOptions.TryGetValue("key1", out keyValue)); 13842Assert.False(classOptions.TryGetValue("key2", out _)); 13843Assert.False(classOptions.TryGetValue("key3", out _)); 13844Assert.True(classOptions.TryGetValue("key4", out keyValue)); 13846Assert.False(classOptions.TryGetValue("key5", out _)); 13847Assert.False(classOptions.TryGetValue("key6", out _)); 13848Assert.False(classOptions.TryGetValue("key7", out _)); 13852Assert.True(generatedOptions.TryGetValue("key1", out keyValue)); 13854Assert.False(generatedOptions.TryGetValue("key2", out _)); 13855Assert.False(generatedOptions.TryGetValue("key3", out _)); 13856Assert.True(classOptions.TryGetValue("key4", out keyValue)); 13858Assert.False(generatedOptions.TryGetValue("key5", out _)); 13859Assert.False(generatedOptions.TryGetValue("key6", out _)); 13860Assert.False(generatedOptions.TryGetValue("key7", out _)); 14152Assert.True(options.TryGetValue("key1", out string val)); 14154Assert.False(options.TryGetValue("key2", out _)); 14155Assert.True(options.TryGetValue("key3", out val)); 14160Assert.False(options.TryGetValue("key1", out _)); 14161Assert.True(options.TryGetValue("key2", out val)); 14163Assert.True(options.TryGetValue("key3", out val)); 14168Assert.False(options.TryGetValue("key1", out _)); 14169Assert.False(options.TryGetValue("key2", out _)); 14170Assert.True(options.TryGetValue("key3", out val));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (3)
SourceGeneration\GeneratorDriverTests.cs (3)
862Assert.True(passedIn!.GlobalOptions.TryGetValue("a", out var item1)); 865Assert.True(passedIn!.GlobalOptions.TryGetValue("b", out var item2)); 2328p.GlobalOptions.TryGetValue("test", out var analyzerOptionsValue);
Microsoft.CodeAnalysis.EditorFeatures (3)
EditorConfigSettings\DataProvider\SettingsProviderBase.cs (3)
132if (_fileDirectoryConfigData.ConfigOptions.TryGetValue(key, out value)) 173if (!_fileDirectoryConfigData.ConfigOptions.TryGetValue(key, out _)) 180if (!_fileDirectoryConfigData.ConfigOptions.TryGetValue(diagnosticKey, out _) &&
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
EditAndContinue\CompileTimeSolutionProviderTests.cs (1)
94(o, ct) => o.GlobalOptions.TryGetValue("build_property.SuppressRazorSourceGenerator", out var value) && bool.Parse(value));
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (2)
448if (context.AnalyzerConfigOptions.GetOptions(syntaxTree).TryGetValue("enc_generator_output", out var optionValue)) 1941var content = context.AnalyzerConfigOptions.GetOptions(syntaxTree).TryGetValue("x", out var optionValue) ? optionValue.ToString() : "none";
Microsoft.CodeAnalysis.Features (2)
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.VisualBasic.CommandLine.UnitTests (6)
CommandLineTests.vb (6)
146Assert.True(options.TryGetValue("my_option", val)) 148Assert.False(options.TryGetValue("my_option2", Nothing)) 149Assert.False(options.TryGetValue("dotnet_diagnostic.bc42024.severity", Nothing)) 153Assert.True(options.TryGetValue("my_option2", val)) 155Assert.False(options.TryGetValue("my_option", Nothing)) 156Assert.False(options.TryGetValue("dotnet_diagnostic.bc42024.severity", Nothing))
Microsoft.CodeAnalysis.Workspaces (12)
AnalyzerConfigOptionsExtensions.cs (1)
39if (analyzerConfigOptions.TryGetValue(option.Definition.ConfigName, out var stringValue))
DiagnosticDescriptorExtensions.cs (6)
62if (analyzerConfigOptions.TryGetValue(diagnosticKey, out var value) && 82if (analyzerConfigOptions.TryGetValue(categoryBasedKey, out value) && 90if (analyzerConfigOptions.TryGetValue(DotnetAnalyzerDiagnosticSeverityKey, out value) && 104if (analyzerConfigOptions.TryGetValue(diagnosticKey, out var value) && 124if (analyzerConfigOptions.TryGetValue(categoryBasedKey, out value) && 132if (analyzerConfigOptions.TryGetValue(DotnetAnalyzerDiagnosticSeverityKey, out value) &&
EditorConfigNamingStyleParser.cs (1)
108trimmedDictionary[key.Trim()] = allRawConventions.TryGetValue(key, out var value) ? value : throw new InvalidOperationException();
GeneratedCodeUtilities.cs (1)
166if (options.TryGetValue("generated_code", out string? optionValue) &&
Options\DocumentOptionSet.cs (1)
87if (!_configOptions.TryGetValue(internallyDefinedOption.Definition.ConfigName, out var stringValue))
StructuredAnalyzerConfigOptions.cs (1)
35=> _options.TryGetValue(key, out value);
Workspace\Solution\SolutionState.CompilationTracker.cs (1)
1113var suppressGenerator = globalOptions.TryGetValue("build_property.SuppressRazorSourceGenerator", out var option) && option == "true";
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
SolutionTests\SolutionTests.cs (1)
4400Assert.Equal(appliedToDocument, documentOptionsViaSyntaxTree.TryGetValue("indent_style", out var value) == true && value == "tab");