723 references to Attribute
aspire (27)
NuGet\TemporaryNuGetConfigFile.cs (1)
119(string?)element.Attribute("key"), "globalPackagesFolder", StringComparison.OrdinalIgnoreCase))
Packaging\PackageChannel.cs (1)
984.Select(element => element.Attribute("id")?.Value)
Projects\DotNetAppHostProject.cs (7)
375var projectAttributeValue = import.Attribute("Project")?.Value; 761var projectAttributeValue = import.Attribute("Project")?.Value; 998var projectAttributeValue = import.Attribute("Project")?.Value; 1260var sdkAttribute = root.Attribute("Sdk")?.Value; 1274&& string.Equals(e.Attribute("Name")?.Value, AspireAppHostSdkName, StringComparison.OrdinalIgnoreCase)); 1289&& string.Equals(e.Attribute("Sdk")?.Value, AspireAppHostSdkName, StringComparison.OrdinalIgnoreCase)); 1296&& string.Equals(e.Attribute("Include")?.Value,
Projects\FallbackProjectParser.cs (11)
147var usesAppHostSdk = DotNetAppHostProject.ContainsAspireAppHostSdk(root.Attribute("Sdk")?.Value ?? string.Empty) 150&& string.Equals(e.Attribute("Name")?.Value, "Aspire.AppHost.Sdk", StringComparison.OrdinalIgnoreCase)) 152&& DotNetAppHostProject.ContainsAspireAppHostSdk(e.Attribute("Sdk")?.Value ?? string.Empty))); 231var sdkAttribute = projectRoot.Attribute("Sdk")?.Value; 244.FirstOrDefault(e => e.Attribute("Name")?.Value == "Aspire.AppHost.Sdk"); 246return sdkElement?.Attribute("Version")?.Value; 287.Where(e => !string.IsNullOrEmpty(e.Attribute("Include")?.Value)); 291var identity = element.Attribute("Include")?.Value; 298var version = element.Attribute("Version")?.Value ?? 320.Where(e => !string.IsNullOrEmpty(e.Attribute("Include")?.Value)); 324var include = element.Attribute("Include")?.Value;
Projects\ProjectUpdater.cs (7)
832&& ContainsAspireAppHostSdk(element.Attribute("Sdk")?.Value ?? string.Empty)) 834&& ((element.Name.LocalName == "Import" && ContainsAspireAppHostSdk(element.Attribute("Sdk")?.Value ?? string.Empty)) 835|| (element.Name.LocalName == "Sdk" && string.Equals(element.Attribute("Name")?.Value, AspireAppHostSdkName, StringComparison.OrdinalIgnoreCase))))); 838=> element.AncestorsAndSelf().All(node => string.IsNullOrWhiteSpace(node.Attribute("Condition")?.Value)); 848if (element.Name.LocalName == "Project" && element.Attribute("Sdk") is { } sdk && ContainsAspireAppHostSdk(sdk.Value)) 1740&& string.Equals(element.Attribute("Include")?.Value, package.Id, StringComparison.OrdinalIgnoreCase)).ToArray(); 1747if (versionElement is not null && reference.Attribute("Version") is null)
Aspire.Cli.EndToEnd.Tests (11)
CentralPackageManagementTests.cs (3)
324.Where(element => string.Equals((string?)element.Attribute("Include"), "Aspire.Hosting.Redis", StringComparison.Ordinal)); 328.Any(element => element.Attribute("Version") is not null); 330.Single().Attribute("Version") is not null;
EmulatedStagingBuildTests.cs (4)
279.Where(e => ((string?)e.Attribute("value"))?.Contains(feedFragment, StringComparison.OrdinalIgnoreCase) == true) 280.Select(e => (string?)e.Attribute("key")) 297.Where(ps => string.Equals((string?)ps.Attribute("key"), stagingSourceKey, StringComparison.OrdinalIgnoreCase)) 299.Any(p => string.Equals((string?)p.Attribute("pattern"), "Aspire*", StringComparison.OrdinalIgnoreCase));
Helpers\CliE2ETestHelpers.cs (3)
41.Where(reference => string.Equals(reference.Attribute("Include")?.Value, "Aspire.Hosting.AppHost", StringComparison.OrdinalIgnoreCase)) 42.Select(reference => reference.Attribute("Version")?.Value) 46var sdk = project.Root?.Attribute("Sdk")?.Value;
NewChannelNuGetConfigTests.cs (1)
77.Select(element => (string?)element.Attribute("value"))
Aspire.Cli.Tests (169)
AssemblyMetadataChannelTests.cs (1)
50(string?)e.Attribute("Condition"),
Commands\AddCommandTests.cs (8)
1499element => element.Attribute("value")?.Value == source); 1500var sourceKey = selectedSource.Attribute("key")?.Value; 1503element => element.Attribute("key")?.Value == sourceKey); 1504Assert.Equal(["Aspire*"], selectedMapping.Elements("package").Select(element => element.Attribute("pattern")?.Value)); 2998Assert.Equal(localSource, localSourceElement.Attribute("key")?.Value); 2999Assert.Equal(localSource, localSourceElement.Attribute("value")?.Value); 3003Assert.Equal(localSource, localSourceMapping.Attribute("key")?.Value); 3005Assert.Equal("Aspire*", packagePattern.Attribute("pattern")?.Value);
Commands\NewCommandLocalTemplateTests.cs (1)
1126config.Root!.Element("packageSources")!.Element("add")!.Attribute("value")!.Value);
Commands\NewCommandTests.cs (7)
773Assert.Equal(sourceOverride, (string?)source.Attribute("value")); 1233element => (string)element.Attribute("key")!, 1234element => (string)element.Attribute("value")!, 1242.Any(package => (string?)package.Attribute("pattern") == "Aspire*")) 1243.Attribute("key")!]; 1247.Any(package => (string?)package.Attribute("pattern") == PackageMapping.AllPackages)) 1248.Attribute("key")!];
Commands\UpdateCommandRepositoryToolsTests.cs (5)
574Assert.Equal("Aspire.AppHost.Sdk/" + targetVersion, XDocument.Load(appHost.FullName).Root!.Attribute("Sdk")!.Value); 576Assert.Equal(targetVersion, packages.Single(package => package.Attribute("Include")!.Value == "Aspire.Hosting.Redis").Attribute("Version")!.Value); 577Assert.Equal("1.0.0", packages.Single(package => package.Attribute("Include")!.Value == "Unrelated.Package").Attribute("Version")!.Value);
DotNet\DotNetAppHostNuGetConfigMergerTests.cs (48)
312Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://feed1.example"); 313Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://feed2.example"); 352Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://feed2.example"); 356Assert.NotNull(psm.Elements("packageSource").First().Elements("package").FirstOrDefault(p => (string?)p.Attribute("pattern") == "Aspire.*")); 392packageSources.Elements("add").Select(e => (string?)e.Attribute("value"))); 508.Select(static source => (string?)source.Attribute("value"))); 630.Where(element => element.Elements("package").Any(package => package.Attribute("pattern")?.Value == "*")) 631.Select(element => element.Attribute("key")!.Value) 744Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("key") == "nuget" && (string?)e.Attribute("value") == "https://api.nuget.org/v3/index.json"); 745Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("key") == "dotnet9" && (string?)e.Attribute("value") == "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json"); 748Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://example.com/aspire-feed"); 785Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("key") == "nuget.org"); 786Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("key") == "custom"); 789Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://example.com/aspire-daily"); 837Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("key") == "nuget.org"); 840Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://example.com/aspire-daily"); 850var nugetMapping = psm.Elements("packageSource").FirstOrDefault(ps => (string?)ps.Attribute("key") == "nuget.org"); 852Assert.Contains(nugetMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*"); 855var aspireMapping = psm.Elements("packageSource").FirstOrDefault(ps => (string?)ps.Attribute("key") == "aspire-test"); 857Assert.Contains(aspireMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "Aspire*"); 858Assert.Contains(aspireMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "Microsoft.Extensions.ServiceDiscovery*"); 904.FirstOrDefault(ps => (string?)ps.Attribute("key") == "nuget.org"); 906Assert.Contains(nugetMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*"); 910.FirstOrDefault(ps => (string?)ps.Attribute("key") == "github"); 912Assert.Contains(githubMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "myorg.*"); 913Assert.Contains(githubMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "other"); 914Assert.DoesNotContain(githubMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*"); 961e => (string?)e.Attribute("value") == "C:\\Users\\user\\.aspire\\hives\\invalid-pr"); 965e => (string?)e.Attribute("value") == "https://valid.example"); 974ps => (string?)ps.Attribute("key") == "C:\\Users\\user\\.aspire\\hives\\invalid-pr"); 978.FirstOrDefault(ps => (string?)ps.Attribute("key") == "https://valid.example"); 980Assert.Contains(validExampleMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "ValidPkg*"); 981Assert.DoesNotContain(validExampleMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*"); 985.FirstOrDefault(ps => (string?)ps.Attribute("key") == "aspire-test"); 987Assert.Contains(nugetMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "Aspire*"); 988Assert.Contains(nugetMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "Microsoft.Extensions.ServiceDiscovery*"); 991nugetMapping.Elements("package").Select(p => (string)p.Attribute("pattern")!)); 1043e => string.Equals((string?)e.Attribute("value"), oldHive, StringComparison.Ordinal)); 1045e => string.Equals((string?)e.Attribute("value"), newHive, StringComparison.Ordinal)); 1049ps => string.Equals((string?)ps.Attribute("key"), oldHive, StringComparison.Ordinal)); 1093e => string.Equals((string?)e.Attribute("value"), oldHive, StringComparison.Ordinal)); 1459.Select(static source => source.Attribute("key")!.Value).Order(StringComparer.Ordinal)); 1461.Where(static mapping => mapping.Attribute("key")?.Value == "aspire-staging") 1463.Select(static pattern => pattern.Attribute("pattern")!.Value); 1523.Select(static source => source.Attribute("key")!.Value)); 1526.Select(static mapping => mapping.Attribute("key")!.Value) ?? []);
NuGet\NuGetClientTests.cs (4)
1615document.Descendants("packageSources").Elements("add").Single().Attribute("value")?.Value); 1619.Select(static package => package.Attribute("pattern")!.Value)); 1622Assert.Equal("other", disabledSources.Elements("add").Single().Attribute("key")?.Value); 1625document.Descendants("config").Elements("add").Single().Attribute("value")?.Value);
NuGet\NuGetPackageOperationConfigurationTests.cs (3)
63.Select(element => (string)element.Attribute("value")!) 71element => (string)element.Attribute("key")!, 73.Select(package => (string)package.Attribute("pattern")!)
NuGet\TemporaryNuGetConfigFileTests.cs (12)
65static element => element.Attribute("value")!.Value, 66static element => element.Attribute("key")!.Value, 72element => element.Attribute("key")?.Value == sourceKeys["https://example.com/feed1"] && 73element.Elements("package").Select(static package => package.Attribute("pattern")?.Value) 77element => element.Attribute("key")?.Value == sourceKeys["https://example.com/feed2"] && 78element.Elements("package").Single().Attribute("pattern")?.Value == PackageMapping.AllPackages); 95.Single(element => element.Attribute("key")?.Value == "globalPackagesFolder") 96.Attribute("value")?.Value); 111.Select(static element => element.Attribute("value")!.Value) 152Assert.Equal("private", mapping.Element("packageSource")?.Attribute("key")?.Value); 153Assert.Equal("Aspire*", mapping.Descendants("package").Single().Attribute("pattern")?.Value); 176.Attribute("pattern")?
Packaging\PackagingServiceTests.cs (2)
1200.FirstOrDefault(add => string.Equals((string?)add.Attribute("key"), "globalPackagesFolder", StringComparison.OrdinalIgnoreCase)); 1202var actualGlobalPackagesFolder = (string?)globalPackagesFolderAdd.Attribute("value");
Projects\AppHostServerProjectTests.cs (10)
274.FirstOrDefault(e => e.Attribute("Update")?.Value == "appsettings.json"); 277Assert.Equal("PreserveNewest", noneElement.Attribute("CopyToOutputDirectory")?.Value); 321element => element.Attribute("Include")?.Value == "Aspire.Hosting.Redis"); 323Assert.Equal("[13.1.0]", packageReference.Attribute("VersionOverride")?.Value); 324Assert.Null(packageReference.Attribute("Version")); 327element => element.Attribute("Include")?.Value == integrationProjectPath); 330element => element.Attribute("Include")?.Value == "Aspire.Hosting.PostgreSQL"); 352element => element.Attribute("Include")?.Value == integrationProjectPath); 357element => element.Attribute("Include")?.Value == "Aspire.Hosting.Redis"); 376.Select(element => element.Attribute("Include")?.Value)
Projects\PrebuiltAppHostServerTests.cs (44)
340Assert.Equal("/path/to/MyIntegration.csproj", projectElements[0].Attribute("Include")?.Value); 346Assert.Equal("Aspire.Hosting", packageReference.Attribute("Include")?.Value); 347Assert.Equal("13.5.0", packageReference.Attribute("Version")?.Value); 371Assert.Equal("Aspire.Hosting", packageReference.Attribute("Include")?.Value); 372Assert.Equal("13.5.0", packageReference.Attribute("Version")?.Value); 376Assert.Equal("Aspire.Hosting.Redis", packageReference.Attribute("Include")?.Value); 377Assert.Equal("13.5.0", packageReference.Attribute("Version")?.Value); 392Assert.Equal("[13.5.0]", packageReference.Attribute("Version")?.Value); 690.Select(static source => source.Attribute("value")!.Value) 732Assert.Equal(restoreConfiguration.PackageSourceAlias, projectSource.Attribute("key")?.Value); 733Assert.Equal(feedDirectory.FullName, projectSource.Attribute("value")?.Value); 793.FirstOrDefault(element => element.Attribute("Name")?.Value == "_WriteAspireClosureManifest"); 796Assert.Equal("Build", target.Attribute("AfterTargets")?.Value); 797Assert.Equal("ResolveLockFileCopyLocalFiles", target.Attribute("DependsOnTargets")?.Value); 1298.FirstOrDefault(a => string.Equals(a.Attribute("key")?.Value, "globalPackagesFolder", StringComparison.OrdinalIgnoreCase)); 1300var gpfValue = gpf.Attribute("value")?.Value; 1358.FirstOrDefault(a => string.Equals(a.Attribute("key")?.Value, "globalPackagesFolder", StringComparison.OrdinalIgnoreCase)); 1360var gpfValue = gpf.Attribute("value")?.Value; 1848.FirstOrDefault(a => string.Equals(a.Attribute("key")?.Value, "globalPackagesFolder", StringComparison.OrdinalIgnoreCase)); 1852var gpfValue = gpf.Attribute("value")?.Value; 3234.Single(element => element.Attribute("key")?.Value == "globalPackagesFolder") 3235.Attribute("value")? 3271.Select(static source => source.Attribute("key")!.Value)); 3280Assert.Equal("Aspire.Hosting", packageElement.Attribute("Include")?.Value); 3281Assert.Equal("13.4.0-pr.17141.gf142085f", packageElement.Attribute("Version")?.Value); 3285Assert.Equal("Aspire.Hosting.Redis", packageElement.Attribute("Include")?.Value); 3286Assert.Equal("13.4.0-pr.17141.gf142085f", packageElement.Attribute("Version")?.Value); 3633ambientConfig.Descendants("config").Elements("add").Single().Attribute("value")?.Value); 4195.Attribute("key")? 4204Assert.Equal("Aspire.Hosting", packageElement.Attribute("Include")?.Value); 4205Assert.Equal("[13.4.0-pr.17166.ga49d604d]", packageElement.Attribute("Version")?.Value); 4209Assert.Equal("Aspire.Hosting.Redis", packageElement.Attribute("Include")?.Value); 4210Assert.Equal("[13.4.0-pr.17166.ga49d604d]", packageElement.Attribute("Version")?.Value); 4214Assert.Equal("CommunityToolkit.Aspire.Hosting.Redis", packageElement.Attribute("Include")?.Value); 4215Assert.Equal("1.0.0", packageElement.Attribute("Version")?.Value); 4423Assert.Equal("Aspire.Hosting", packageReference.Attribute("Include")?.Value); 4424Assert.Equal("13.2.0", packageReference.Attribute("Version")?.Value); 4428Assert.Equal("Aspire.Hosting.Redis", packageReference.Attribute("Include")?.Value); 4429Assert.Equal("13.2.0", packageReference.Attribute("Version")?.Value); 5368element.Attribute("value")?.Value, 5370?.Attribute("key") 5373.Select(static element => element.Attribute("key")?.Value) 5397element.Attribute("key")?.Value, 5401.Select(static element => element.Attribute("pattern")?.Value)
Projects\ProjectUpdaterNuGetConfigurationTests.cs (3)
1478Assert.Equal("Aspire.Hosting.Redis", (string?)package.Attribute("Include")); 1479Assert.Equal("9.4.2", (string?)package.Attribute("Version")); 1708.Select(static item => item.Attribute("value")!.Value));
Projects\ProjectUpdaterTests.cs (11)
154Assert.Equal("Aspire.AppHost.Sdk/17.0.0-preview.1", importedDocument.Root!.Attribute("Sdk")!.Value); 158Assert.Null(importedDocument.Root!.Attribute("Sdk")); 159Assert.All(importedDocument.Root.Elements().Where(element => element.Attribute("Condition") is null), 160element => Assert.Equal("17.0.0-preview.1", element.Attribute("Version")!.Value)); 165.Single(element => element.Attribute("Condition") is not null).Attribute("Version")!.Value); 315Assert.Equal("17.0.1-preview.1", cpm.Descendants("PackageVersion").Single().Attribute("Version")!.Value); 322Assert.Equal("17.0.1-preview.1", childVersion ? reference.Element("Version")!.Value : reference.Attribute("Version")!.Value); 325Assert.Null(reference.Attribute("Version")); 329Assert.Equal("8.2.1", props.Descendants("Import").Single().Attribute("Version")!.Value); 4514(string?)Assert.Single(document.Root.Element("packageSources")!.Elements("add")).Attribute("value"));
Templating\TemplateNuGetConfigServiceTests.cs (9)
565.Select(e => (string)e.Attribute("value")!) 624.Select(e => (string)e.Attribute("value")!) 745.Select(e => (string)e.Attribute("value")!) 1312(string?)element.Attribute("value") == source || 1313string.Equals((string?)element.Attribute("key"), source, StringComparison.OrdinalIgnoreCase)) 1314?.Attribute("key") 1324.Where(e => string.Equals((string?)e.Attribute("key"), sourceKey, StringComparison.OrdinalIgnoreCase)) 1326.Select(e => (string?)e.Attribute("pattern")) 1365.Select(e => (string)e.Attribute("value")!)
TestServices\FakeNuGetClient.cs (1)
82.Select(static source => source.Attribute("value")!.Value))
Aspire.Dashboard (1)
Model\ResourceGraph\ResourceGraphMapper.cs (1)
99.Select(e => e.Attribute("d")?.Value ?? throw new InvalidOperationException($"Icon '{icon.Name}' contains an element without path data."))
Aspire.Dashboard.Tests (2)
Model\ResourceGraphMapperTests.cs (2)
183var expectedPathData = XElement.Parse(icon.Content).Attribute("d")!.Value; 195var expectedPaths = iconContent.Elements().Select(e => e.Attribute("d")!.Value).ToArray();
Aspire.Hosting.Azure.Provisioning.Generators (1)
AspireProvisioningProxyGenerator.cs (1)
2133string.Equals(element.Attribute("name")?.Value, parameter.SourceName, StringComparison.Ordinal))
Aspire.Hosting.Maui.Tests (11)
MauiEnvironmentHelperTests.cs (11)
48Assert.Equal("MY_VAR=hello", items[0].Attribute("Include")?.Value); 49Assert.Equal("OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317", items[1].Attribute("Include")?.Value); 64.FirstOrDefault(t => t.Attribute("Name")?.Value == "AspireGenerateAndroidEnvironmentFiles"); 66Assert.Equal("_GenerateEnvironmentFiles", target.Attribute("BeforeTargets")?.Value); 82Assert.Equal("$(IntermediateOutputPath)__aspire_environment__.txt", writeLines.Attribute("File")?.Value); 98.Select(item => item.Attribute("Include")?.Value) 141Assert.Equal("MY_VAR=hello", items[0].Attribute("Include")?.Value); 142Assert.Equal("OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317", items[1].Attribute("Include")?.Value); 157.FirstOrDefault(t => t.Attribute("Name")?.Value == "AspireLogMlaunchEnvironmentVariables"); 159Assert.Equal("PrepareForBuild", target.Attribute("AfterTargets")?.Value); 175.Select(item => item.Attribute("Include")?.Value)
Aspire.Hosting.Native.CodeGeneration (7)
src\Aspire.Hosting.RemoteHost\AtsCapabilityScanner.cs (7)
3566.FirstOrDefault(m => string.Equals(m.Attribute("name")?.Value, memberName, StringComparison.Ordinal)); 3587.Select(param => param.Attribute("name")?.Value) 3631Name = param.Attribute("name")?.Value ?? string.Empty, 3714builder.Append(element.Attribute("name")?.Value); 3740var cref = element.Attribute("cref")?.Value; 3824var langword = element.Attribute("langword")?.Value; 3838var cref = element.Attribute("cref")?.Value;
Aspire.Hosting.RemoteHost (7)
AtsCapabilityScanner.cs (7)
3566.FirstOrDefault(m => string.Equals(m.Attribute("name")?.Value, memberName, StringComparison.Ordinal)); 3587.Select(param => param.Attribute("name")?.Value) 3631Name = param.Attribute("name")?.Value ?? string.Empty, 3714builder.Append(element.Attribute("name")?.Value); 3740var cref = element.Attribute("cref")?.Value; 3824var langword = element.Attribute("langword")?.Value; 3838var cref = element.Attribute("cref")?.Value;
Aspire.Templates.Tests (9)
BuildAndRunTemplateTests.cs (3)
100if (reference.Attribute("Version") is { } versionAttribute) 103new XAttribute("Include", reference.Attribute("Include")!.Value), 165.Where(reference => reference.Attribute("Include")?.Value == "Aspire.Hosting.AppHost")
NewUpAndBuildStandaloneTemplateTests.cs (3)
59.Where(element => element.Attribute("Include")?.Value != "Aspire.Hosting.Testing") 60.Select(element => $"{element.Attribute("Include")?.Value}/{element.Attribute("Version")?.Value}")
NewUpAndBuildSupportProjectTemplatesTests.cs (3)
69.Where(element => element.Attribute("Include")?.Value != "Aspire.Hosting.Testing") 70.Select(element => $"{element.Attribute("Include")?.Value}/{element.Attribute("Version")?.Value}")
Aspire.Tray.Tests (1)
MacTrayStartupSettingsTests.cs (1)
20Assert.Equal("1.0", xml.Root.Attribute("version")!.Value);
dotnet-svcutil-lib (2)
Shared\Utilities\RuntimeEnvironmentHelper.cs (2)
87.Select(e => e.Attribute("value").Value.TrimEnd(Path.DirectorySeparatorChar)) 95while (pkgSourcesNode.Elements("add").Any(e => StringComparer.OrdinalIgnoreCase.Compare(e.Attribute("key").Value, feedName) == 0))
GenerateDocumentationAndConfigFiles (19)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 148XAttribute? ruleId = ruleNode.Attribute(RuleIdAttributeName);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (4)
162var typeAttribute = element.Attribute(XmlAttribute_Type); 163var valueAttribute = element.Attribute(XmlAttribute_Value); 164var severityAttribute = element.Attribute(XmlAttribute_DiagnosticSeverity); 165var version = (int?)element.Attribute(XmlAttribute_SerializationVersion);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (6)
476id: Guid.Parse(namingStyleElement.Attribute(nameof(ID)).Value), 477name: namingStyleElement.Attribute(nameof(Name)).Value, 478prefix: namingStyleElement.Attribute(nameof(Prefix)).Value, 479suffix: namingStyleElement.Attribute(nameof(Suffix)).Value, 480wordSeparator: namingStyleElement.Attribute(nameof(WordSeparator)).Value, 481capitalizationScheme: (Capitalization)Enum.Parse(typeof(Capitalization), namingStyleElement.Attribute(nameof(CapitalizationScheme)).Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
399var serializationVersion = int.Parse(rootElement.Attribute("SerializationVersion")!.Value);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SerializableNamingRule.cs (3)
38EnforcementLevel = ((DiagnosticSeverity)Enum.Parse(typeof(DiagnosticSeverity), namingRuleElement.Attribute(nameof(EnforcementLevel))!.Value)).ToReportDiagnostic(), 39NamingStyleID = Guid.Parse(namingRuleElement.Attribute(nameof(NamingStyleID))!.Value), 40SymbolSpecificationID = Guid.Parse(namingRuleElement.Attribute(nameof(SymbolSpecificationID))!.Value)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
279id: Guid.Parse(symbolSpecificationElement.Attribute(nameof(ID)).Value), 280name: symbolSpecificationElement.Attribute(nameof(Name)).Value,
GenerateTemplateManifest (6)
Program.cs (2)
159.Select(p => p.Attribute("pattern")!.Value) 206project.Project.Attribute("Sdk")!.Value.StartsWith("Microsoft.VisualStudio.JavaScript.Sdk/", StringComparison.Ordinal))
TemplateRestorePlan.cs (4)
198var relative = reference.Attribute("Include")!.Value.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 207foreach (var sdk in (project.Attribute("Sdk")?.Value ?? "").Split(';')) 267groups.SelectMany(g => g.Elements()).Any(e => e.Attribute("Update") is not null || e.Attribute("Remove") is not null) ||
ilc (9)
RdXmlRootProvider.cs (9)
57var assemblyNameAttribute = assemblyElement.Attribute("Name"); 65var dynamicDegreeAttribute = assemblyElement.Attribute("Dynamic"); 92var typeNameAttribute = typeElement.Attribute("Name"); 99var dynamicDegreeAttribute = typeElement.Attribute("Dynamic"); 108var marshalStructureDegreeAttribute = typeElement.Attribute("MarshalStructure"); 117var marshalDelegateDegreeAttribute = typeElement.Attribute("MarshalDelegate"); 141var methodNameAttribute = methodElement.Attribute("Name"); 152string paramName = element.Attribute("Name").Value; 156string instArgName = element.Attribute("Name").Value;
Infrastructure.Tests (36)
Pipelines\TrayBundleTests.cs (26)
128var dependencies = build.Attribute("DependsOnTargets")!.Value.Split(';', StringSplitOptions.TrimEntries); 130Assert.Equal("($(TargetRid.StartsWith('osx-')) or $(TargetRid.StartsWith('win-'))) and '$(SkipTrayBuild)' != 'true'", Target(project, "_PublishNativeTray").Attribute("Condition")!.Value); 131Assert.Equal("'$(SkipNativeBuild)' != 'true'", Target(project, "_PublishNativeCli").Attribute("Condition")!.Value); 136Assert.Contains("$(_CliPublishOutputArg)", Assert.Single(cliPublish.Elements("Exec")).Attribute("Command")!.Value); 143Assert.Equal("Publish", Target(project, "PackageTray").Attribute("AfterTargets")!.Value); 145Assert.Null(restore.Attribute("DependsOnTargets")); 146Assert.Contains(restore.Elements("Exec"), exec => exec.Attribute("Command")!.Value.StartsWith("ditto -xk", StringComparison.Ordinal)); 147Assert.Contains(restore.Elements("Exec"), exec => exec.Attribute("Command")!.Value.Contains("anchor apple generic", StringComparison.Ordinal)); 152.Select(element => element.Attribute("Include")!.Value) 156Assert.Equal("$(TraySigningArchive)", input.Attribute("Include")!.Value); 159Assert.Equal(input.Attribute("Include")!.Value, notarization.Attribute("Include")!.Value); 163Assert.Equal("ValidateTraySigning", signTray.Attribute("DependsOnTargets")!.Value); 165signTray.Elements("SignFiles").Select(task => task.Attribute("Files")!.Value)); 225Assert.Equal("_RunCreateLayout", verification.Attribute("AfterTargets")!.Value); 226Assert.Equal("$(TargetRid.StartsWith('osx-'))", verification.Attribute("Condition")!.Value); 227var command = Assert.Single(verification.Elements("Exec")).Attribute("Command")!.Value; 234Assert.Contains(solution.Descendants("Project"), entry => entry.Attribute("Path")?.Value == testProjectPath); 270exec => Assert.Contains("$(_OfficialBuildIdArg)", exec.Attribute("Command")!.Value)); 350element => element.Attribute("Include")?.Value == "aspire-tray.exe").Attribute("CertificateName")!.Value); 352element => element.Attribute("Include")?.Value == @"$(ArtifactsBinDir)Aspire.Tray.Windows\**\publish\aspire-tray.exe"); 355Assert.Equal("_RunCreateLayout", verify.Attribute("AfterTargets")!.Value); 356Assert.Equal("$(TargetRid.StartsWith('win-'))", verify.Attribute("Condition")!.Value); 358exec => Assert.Contains("verify-windows-tray-payload.ps1", exec.Attribute("Command")!.Value)); 470=> Assert.Single(project.Descendants("Target"), target => target.Attribute("Name")?.Value == name);
ResourceGeneratorMetadataTests.cs (2)
76.Single(item => item.Attribute("Include")?.Value == settingsDesignerPath); 81.Single(item => item.Attribute("Include")?.Value == otherResources[^1]);
TemplateManifest\TemplateManifestBuildTargetTests.cs (1)
42(string?)target.Attribute("Name") is "GenerateTemplateCgManifest" or "_CleanTemplateCgRestore")
TemplateManifest\TemplateManifestCacheTests.cs (1)
77var path = project.Attribute("Path")!.Value.Replace('/', Path.DirectorySeparatorChar);
TemplateManifest\TemplateRestorePlanTests.cs (6)
84.Select(p => p.Project.Descendants("PackageReference").Single().Attribute("Version")!.Value).Order()); 115Assert.Equal($"../{child.Name}/{child.Name}.csproj", parent.Project.Descendants("ProjectReference").Single().Attribute("Include")!.Value); 117Assert.Equal("all", parent.Project.Descendants("PackageReference").Single().Attribute("PrivateAssets")!.Value); 118Assert.Equal("Microsoft.AspNetCore.App", parent.Project.Descendants("FrameworkReference").Single().Attribute("Include")!.Value); 134Assert.Equal("'$(Mode)' == 'first'", normalized.Elements("PropertyGroup").Last().Attribute("Condition")!.Value); 266Assert.Equal("Additional", project.Project.Descendants("PackageReference").Single().Attribute("Include")!.Value);
Microsoft.AspNetCore.DataProtection (18)
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorDescriptorDeserializer.cs (2)
34configuration.EncryptionAlgorithm = (EncryptionAlgorithm)Enum.Parse(typeof(EncryptionAlgorithm), (string)encryptionElement.Attribute("algorithm")!); 40configuration.ValidationAlgorithm = (ValidationAlgorithm)Enum.Parse(typeof(ValidationAlgorithm), (string)validationElement.Attribute("algorithm")!);
AuthenticatedEncryption\ConfigurationModel\CngCbcAuthenticatedEncryptorDescriptorDeserializer.cs (5)
36configuration.EncryptionAlgorithm = (string)encryptionElement.Attribute("algorithm")!; 37configuration.EncryptionAlgorithmKeySize = (int)encryptionElement.Attribute("keyLength")!; 38configuration.EncryptionAlgorithmProvider = (string?)encryptionElement.Attribute("provider"); // could be null 41configuration.HashAlgorithm = (string)hashElement.Attribute("algorithm")!; 42configuration.HashAlgorithmProvider = (string?)hashElement.Attribute("provider"); // could be null
AuthenticatedEncryption\ConfigurationModel\CngGcmAuthenticatedEncryptorDescriptorDeserializer.cs (3)
35configuration.EncryptionAlgorithm = (string)encryptionElement.Attribute("algorithm")!; 36configuration.EncryptionAlgorithmKeySize = (int)encryptionElement.Attribute("keyLength")!; 37configuration.EncryptionAlgorithmProvider = (string?)encryptionElement.Attribute("provider"); // could be null
AuthenticatedEncryption\ConfigurationModel\ManagedAuthenticatedEncryptorDescriptorDeserializer.cs (3)
35configuration.EncryptionAlgorithmType = ManagedAlgorithmHelpers.FriendlyNameToType((string)encryptionElement.Attribute("algorithm")!); 36configuration.EncryptionAlgorithmKeySize = (int)encryptionElement.Attribute("keyLength")!; 39configuration.ValidationAlgorithmType = ManagedAlgorithmHelpers.FriendlyNameToType((string)validationElement.Attribute("algorithm")!);
AuthenticatedEncryption\ConfigurationModel\XmlExtensions.cs (1)
17return ((bool?)element.Attribute(XmlConstants.RequiresEncryptionAttributeName)).GetValueOrDefault();
KeyManagement\XmlKeyManager.cs (3)
295Guid keyId = (Guid)keyElement.Attribute(IdAttributeName)!; 350string keyIdAsString = (string)revocationElement.Element(KeyElementName)!.Attribute(IdAttributeName)!; 577string descriptorDeserializerTypeName = (string)descriptorElement!.Attribute(DeserializerTypeAttributeName)!;
XmlEncryption\XmlEncryptionExtensions.cs (1)
50string decryptorTypeName = (string)clonedElementWhichRequiresDecryption.Attribute(XmlConstants.DecryptorTypeAttributeName)!;
Microsoft.AspNetCore.OpenApi.SourceGenerators (9)
XmlCommentGenerator.Parser.cs (1)
64var name = member.Attribute(DocumentationCommentXmlNames.NameAttributeName)?.Value;
XmlComments\XmlComment.cs (5)
76var rawListType = element.Attribute(DocumentationCommentXmlNames.TypeAttributeName)?.Value; 121var paramName = element.Attribute(DocumentationCommentXmlNames.NameAttributeName)?.Value; 136var paramName = element.Attribute(DocumentationCommentXmlNames.NameAttributeName)?.Value; 190var cref = item.Attribute(attributeName).Value; 222var langword = item.Attribute(attributeName).Value;
XmlComments\XmlComment.InheritDoc.cs (3)
144var crefAttribute = element.Attribute(XName.Get(DocumentationCommentXmlNames.CrefAttributeName)); 145var pathAttribute = element.Attribute(XName.Get(DocumentationCommentXmlNames.PathAttributeName)); 234if (typeParameterRef.Attribute(DocumentationCommentXmlNames.NameAttributeName) is XAttribute typeParamName)
Microsoft.AspNetCore.Rewrite (15)
IISUrlRewrite\RewriteMapParser.cs (3)
24var map = new IISRewriteMap(mapElement.Attribute(RewriteTags.Name)?.Value!); 27map[addElement.Attribute(RewriteTags.Key)!.Value.ToLowerInvariant()] = addElement.Attribute(RewriteTags.Value)!.Value;
IISUrlRewrite\UrlRewriteFileParser.cs (12)
60builder.Name = rule.Attribute(RewriteTags.Name)?.Value; 93var parsedInputString = match.Attribute(RewriteTags.Url)?.Value; 132var parsedInputString = conditionElement.Attribute(RewriteTags.Input)?.Value; 139var parsedPatternString = conditionElement.Attribute(RewriteTags.Pattern)?.Value; 200if (urlAction.Attribute(RewriteTags.Url) != null) 202url = urlAction.Attribute(RewriteTags.Url)!.Value; 227if (!int.TryParse(urlAction.Attribute(RewriteTags.StatusCode)?.Value, NumberStyles.None, CultureInfo.InvariantCulture, out statusCode)) 237if (!string.IsNullOrEmpty(urlAction.Attribute(RewriteTags.SubStatusCode)?.Value)) 242var statusReason = urlAction.Attribute(RewriteTags.StatusReason)?.Value; 243var statusDescription = urlAction.Attribute(RewriteTags.StatusDescription)?.Value; 256var attribute = element.Attribute(rewriteTag); 272var attribute = element.Attribute(rewriteTag);
Microsoft.AspNetCore.Server.IntegrationTesting (1)
xunit\IISExpressAncmSchema.cs (1)
46.Any(n => "hostingModel".Equals(n.Attribute("name")?.Value, StringComparison.Ordinal));
Microsoft.Build.Tasks.Core (12)
AssemblyDependency\GenerateBindingRedirects.cs (5)
240var name = assemblyIdentity.Attribute("name"); 241var publicKeyToken = assemblyIdentity.Attribute("publicKeyToken"); 250var culture = assemblyIdentity.Attribute("culture"); 253var oldVersionAttribute = bindingRedirect.Attribute("oldVersion"); 254var newVersionAttribute = bindingRedirect.Attribute("newVersion");
GenerateResource.cs (1)
3138string name = dataElem.Attribute("name").Value;
ResourceHandling\MSBuildResXReader.cs (6)
60string alias = elem.Attribute("alias")?.Value; 61string name = elem.Attribute("name").Value; 120string name = elem.Attribute("name").Value; 122bool preserve = elem.Attribute(XName.Get("space", "http://www.w3.org/XML/1998/namespace"))?.Value == "preserve"; 143string typename = elem.Attribute("type")?.Value; 144string mimetype = elem.Attribute("mimetype")?.Value;
Microsoft.CodeAnalysis (1)
RuleSet\RuleSetProcessor.cs (1)
255XAttribute attribute = node.Attribute(attributeName);
Microsoft.CodeAnalysis.Analyzers (20)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_ResourceStringsFormat.cs (1)
78if (!(dataElement.Attribute("name")?.Value is { } name) ||
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 148XAttribute? ruleId = ruleNode.Attribute(RuleIdAttributeName);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (4)
162var typeAttribute = element.Attribute(XmlAttribute_Type); 163var valueAttribute = element.Attribute(XmlAttribute_Value); 164var severityAttribute = element.Attribute(XmlAttribute_DiagnosticSeverity); 165var version = (int?)element.Attribute(XmlAttribute_SerializationVersion);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (6)
476id: Guid.Parse(namingStyleElement.Attribute(nameof(ID)).Value), 477name: namingStyleElement.Attribute(nameof(Name)).Value, 478prefix: namingStyleElement.Attribute(nameof(Prefix)).Value, 479suffix: namingStyleElement.Attribute(nameof(Suffix)).Value, 480wordSeparator: namingStyleElement.Attribute(nameof(WordSeparator)).Value, 481capitalizationScheme: (Capitalization)Enum.Parse(typeof(Capitalization), namingStyleElement.Attribute(nameof(CapitalizationScheme)).Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
399var serializationVersion = int.Parse(rootElement.Attribute("SerializationVersion")!.Value);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SerializableNamingRule.cs (3)
38EnforcementLevel = ((DiagnosticSeverity)Enum.Parse(typeof(DiagnosticSeverity), namingRuleElement.Attribute(nameof(EnforcementLevel))!.Value)).ToReportDiagnostic(), 39NamingStyleID = Guid.Parse(namingRuleElement.Attribute(nameof(NamingStyleID))!.Value), 40SymbolSpecificationID = Guid.Parse(namingRuleElement.Attribute(nameof(SymbolSpecificationID))!.Value)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
279id: Guid.Parse(symbolSpecificationElement.Attribute(nameof(ID)).Value), 280name: symbolSpecificationElement.Attribute(nameof(Name)).Value,
Microsoft.CodeAnalysis.AnalyzerUtilities (19)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 148XAttribute? ruleId = ruleNode.Attribute(RuleIdAttributeName);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (4)
162var typeAttribute = element.Attribute(XmlAttribute_Type); 163var valueAttribute = element.Attribute(XmlAttribute_Value); 164var severityAttribute = element.Attribute(XmlAttribute_DiagnosticSeverity); 165var version = (int?)element.Attribute(XmlAttribute_SerializationVersion);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (6)
476id: Guid.Parse(namingStyleElement.Attribute(nameof(ID)).Value), 477name: namingStyleElement.Attribute(nameof(Name)).Value, 478prefix: namingStyleElement.Attribute(nameof(Prefix)).Value, 479suffix: namingStyleElement.Attribute(nameof(Suffix)).Value, 480wordSeparator: namingStyleElement.Attribute(nameof(WordSeparator)).Value, 481capitalizationScheme: (Capitalization)Enum.Parse(typeof(Capitalization), namingStyleElement.Attribute(nameof(CapitalizationScheme)).Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
399var serializationVersion = int.Parse(rootElement.Attribute("SerializationVersion")!.Value);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SerializableNamingRule.cs (3)
38EnforcementLevel = ((DiagnosticSeverity)Enum.Parse(typeof(DiagnosticSeverity), namingRuleElement.Attribute(nameof(EnforcementLevel))!.Value)).ToReportDiagnostic(), 39NamingStyleID = Guid.Parse(namingRuleElement.Attribute(nameof(NamingStyleID))!.Value), 40SymbolSpecificationID = Guid.Parse(namingRuleElement.Attribute(nameof(SymbolSpecificationID))!.Value)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
279id: Guid.Parse(symbolSpecificationElement.Attribute(nameof(ID)).Value), 280name: symbolSpecificationElement.Attribute(nameof(Name)).Value,
Microsoft.CodeAnalysis.CodeStyle (16)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (4)
162var typeAttribute = element.Attribute(XmlAttribute_Type); 163var valueAttribute = element.Attribute(XmlAttribute_Value); 164var severityAttribute = element.Attribute(XmlAttribute_DiagnosticSeverity); 165var version = (int?)element.Attribute(XmlAttribute_SerializationVersion);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (6)
476id: Guid.Parse(namingStyleElement.Attribute(nameof(ID)).Value), 477name: namingStyleElement.Attribute(nameof(Name)).Value, 478prefix: namingStyleElement.Attribute(nameof(Prefix)).Value, 479suffix: namingStyleElement.Attribute(nameof(Suffix)).Value, 480wordSeparator: namingStyleElement.Attribute(nameof(WordSeparator)).Value, 481capitalizationScheme: (Capitalization)Enum.Parse(typeof(Capitalization), namingStyleElement.Attribute(nameof(CapitalizationScheme)).Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
399var serializationVersion = int.Parse(rootElement.Attribute("SerializationVersion")!.Value);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SerializableNamingRule.cs (3)
38EnforcementLevel = ((DiagnosticSeverity)Enum.Parse(typeof(DiagnosticSeverity), namingRuleElement.Attribute(nameof(EnforcementLevel))!.Value)).ToReportDiagnostic(), 39NamingStyleID = Guid.Parse(namingRuleElement.Attribute(nameof(NamingStyleID))!.Value), 40SymbolSpecificationID = Guid.Parse(namingRuleElement.Attribute(nameof(SymbolSpecificationID))!.Value)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
279id: Guid.Parse(symbolSpecificationElement.Attribute(nameof(ID)).Value), 280name: symbolSpecificationElement.Attribute(nameof(Name)).Value,
Microsoft.CodeAnalysis.CSharp (4)
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (4)
276XAttribute fileAttr = includeElement.Attribute(XName.Get(DocumentationCommentXmlNames.FileAttributeName)); 277XAttribute pathAttr = includeElement.Attribute(XName.Get(DocumentationCommentXmlNames.PathAttributeName)); 296XAttribute fileAttr = includeElement.Attribute(XName.Get(DocumentationCommentXmlNames.FileAttributeName)); 297XAttribute pathAttr = includeElement.Attribute(XName.Get(DocumentationCommentXmlNames.PathAttributeName));
Microsoft.CodeAnalysis.Features (3)
DocumentationComments\AbstractDocumentationCommentFormattingService.cs (3)
407var rawListType = element.Attribute(DocumentationCommentXmlNames.TypeAttributeName)?.Value; 467var crefAttribute = element.Attribute(DocumentationCommentXmlNames.CrefAttributeName); 475var hrefAttribute = element.Attribute(DocumentationCommentXmlNames.HrefAttributeName);
Microsoft.CodeAnalysis.NetAnalyzers (3)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
51var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 52var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 147XAttribute? ruleId = ruleNode.Attribute(RuleIdAttributeName);
Microsoft.CodeAnalysis.ResxSourceGenerator (20)
AbstractResxGenerator.cs (1)
446var name = node.Attribute("name")?.Value;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 148XAttribute? ruleId = ruleNode.Attribute(RuleIdAttributeName);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (4)
162var typeAttribute = element.Attribute(XmlAttribute_Type); 163var valueAttribute = element.Attribute(XmlAttribute_Value); 164var severityAttribute = element.Attribute(XmlAttribute_DiagnosticSeverity); 165var version = (int?)element.Attribute(XmlAttribute_SerializationVersion);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (6)
476id: Guid.Parse(namingStyleElement.Attribute(nameof(ID)).Value), 477name: namingStyleElement.Attribute(nameof(Name)).Value, 478prefix: namingStyleElement.Attribute(nameof(Prefix)).Value, 479suffix: namingStyleElement.Attribute(nameof(Suffix)).Value, 480wordSeparator: namingStyleElement.Attribute(nameof(WordSeparator)).Value, 481capitalizationScheme: (Capitalization)Enum.Parse(typeof(Capitalization), namingStyleElement.Attribute(nameof(CapitalizationScheme)).Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
399var serializationVersion = int.Parse(rootElement.Attribute("SerializationVersion")!.Value);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SerializableNamingRule.cs (3)
38EnforcementLevel = ((DiagnosticSeverity)Enum.Parse(typeof(DiagnosticSeverity), namingRuleElement.Attribute(nameof(EnforcementLevel))!.Value)).ToReportDiagnostic(), 39NamingStyleID = Guid.Parse(namingRuleElement.Attribute(nameof(NamingStyleID))!.Value), 40SymbolSpecificationID = Guid.Parse(namingRuleElement.Attribute(nameof(SymbolSpecificationID))!.Value)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
279id: Guid.Parse(symbolSpecificationElement.Attribute(nameof(ID)).Value), 280name: symbolSpecificationElement.Attribute(nameof(Name)).Value,
Microsoft.CodeAnalysis.Workspaces (19)
Shared\Extensions\ISymbolExtensions.cs (3)
346var crefAttribute = element.Attribute(XName.Get(DocumentationCommentXmlNames.CrefAttributeName)); 347var pathAttribute = element.Attribute(XName.Get(DocumentationCommentXmlNames.PathAttributeName)); 428if (typeParameterRef.Attribute(DocumentationCommentXmlNames.NameAttributeName) is XAttribute typeParamName)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (4)
162var typeAttribute = element.Attribute(XmlAttribute_Type); 163var valueAttribute = element.Attribute(XmlAttribute_Value); 164var severityAttribute = element.Attribute(XmlAttribute_DiagnosticSeverity); 165var version = (int?)element.Attribute(XmlAttribute_SerializationVersion);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (6)
476id: Guid.Parse(namingStyleElement.Attribute(nameof(ID)).Value), 477name: namingStyleElement.Attribute(nameof(Name)).Value, 478prefix: namingStyleElement.Attribute(nameof(Prefix)).Value, 479suffix: namingStyleElement.Attribute(nameof(Suffix)).Value, 480wordSeparator: namingStyleElement.Attribute(nameof(WordSeparator)).Value, 481capitalizationScheme: (Capitalization)Enum.Parse(typeof(Capitalization), namingStyleElement.Attribute(nameof(CapitalizationScheme)).Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
399var serializationVersion = int.Parse(rootElement.Attribute("SerializationVersion")!.Value);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SerializableNamingRule.cs (3)
38EnforcementLevel = ((DiagnosticSeverity)Enum.Parse(typeof(DiagnosticSeverity), namingRuleElement.Attribute(nameof(EnforcementLevel))!.Value)).ToReportDiagnostic(), 39NamingStyleID = Guid.Parse(namingRuleElement.Attribute(nameof(NamingStyleID))!.Value), 40SymbolSpecificationID = Guid.Parse(namingRuleElement.Attribute(nameof(SymbolSpecificationID))!.Value)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
279id: Guid.Parse(symbolSpecificationElement.Attribute(nameof(ID)).Value), 280name: symbolSpecificationElement.Attribute(nameof(Name)).Value,
Microsoft.DotNet.Arcade.Sdk (3)
src\ExtractNgenMethodList.cs (2)
64var flagsInt = child.Attribute("flagsInt"); 65var name = child.Attribute("name");
src\GenerateResxSource.cs (1)
112string name = node.Attribute("name")?.Value;
Microsoft.DotNet.Build.Manifest (1)
XElementParsingExtensions.cs (1)
15string value = element.Attribute(name)?.Value;
Microsoft.DotNet.Build.Tasks.Installers (8)
src\CreateWixBuildWixpack.cs (2)
579var source = element.Attribute(sourceAttr)?.Value; 631var id = element.Attribute(idAttr)?.Value;
src\GenerateMacOSDistributionFile.cs (3)
84.WithAttribute("id", c.Attribute("id").Value + ".alternate") 90.Select(c => new XElement("line", new XAttribute("choice", c.Attribute("id").Value))); 103if (optionsElement.Attribute("hostArchitectures") is null)
src\StabilizeWixFileId.cs (3)
77.Where(f => f.Attribute("Source")?.Value 90XAttribute nameAttribute = matchingFileElements[0].Attribute("Id"); 100matchingFileElements[0].Attribute("Source").Value);
Microsoft.DotNet.Build.Tasks.Packaging (2)
PackageIndex.cs (2)
219string assemblyName = file.Attribute("AssemblyName").Value; 220var versionAttribute = file.Attribute("Version");
Microsoft.DotNet.Build.Tasks.VisualStudio (2)
Vsix\FinalizeInsertionVsixFile.cs (2)
84var experimental = installationElement.Attribute("Experimental"); 93var systemComponent = installationElement.Attribute(systemComponentName);
Microsoft.DotNet.Build.Tasks.Workloads (1)
Msi\WixDocument.cs (1)
69if (element.Attribute("Id")?.Value == id)
Microsoft.DotNet.MacOsPkg.Core (1)
Package.cs (1)
203pkgInfo.Attribute(elementName)?.Value ?? throw new Exception($"{elementName} is required in PackageInfo");
Microsoft.DotNet.NuGetRepack.Tasks (3)
src\NuGetVersionUpdater.cs (3)
262var name = packageType.Attribute("name"); 288string id = dependency.Attribute("id")?.Value; 294var versionRangeAttribute = dependency.Attribute("version");
Microsoft.DotNet.SourceBuild.Tasks (10)
src\UsageReport\Usage.cs (4)
41AssetsFile = xml.Attribute("File")?.Value, 42IsDirectDependency = Convert.ToBoolean(xml.Attribute(nameof(IsDirectDependency))?.Value), 43IsAutoReferenced = Convert.ToBoolean(xml.Attribute(nameof(IsAutoReferenced))?.Value), 44RuntimePackageRid = xml.Attribute("Rid")?.Value
src\UsageReport\UsagePattern.cs (2)
22IdentityRegex = xml.Attribute(nameof(IdentityRegex))?.Value, 23IdentityGlob = xml.Attribute(nameof(IdentityGlob))?.Value
src\UsageReport\WriteUsageReports.cs (2)
93x.Attribute("Id")?.Value, 94x.Attribute("OriginBuildName")?.Value);
src\UsageReport\XmlParsingHelpers.cs (2)
27xml.Attribute("Id").Value, 28NuGetVersion.Parse(xml.Attribute("Version").Value));
Microsoft.DotNet.XliffTasks (22)
Model\ResxDocument.cs (4)
21if (node.Attribute("type") != null || node.Attribute("mimetype") != null) 26string name = node.Attribute("name").Value; 61if (node.Attribute("type")?.Value == "System.Resources.ResXFileRef, System.Windows.Forms")
Model\VsctDocument.cs (5)
22string id = strings.Parent.Attribute("id").Value; 27string guid = strings.Parent.Attribute("guid").Value; 66string id = strings.Parent.Attribute("id").Value; 81XAttribute hrefAttribute = imageTag.Attribute("href"); 89imageTag.Attribute("href").Value = absolutePath;
Model\XamlRuleDocument.cs (6)
53var localizableProperties = element.Attribute(XName.Get(LocalizedPropertiesAttributeName, XliffTasksNs))?.Value?.Split(';'); 155idBuilder.Append(element.Parent.Attribute("Name") is null ? XmlName(element.Parent) : $"{XmlName(element.Parent)}|{AttributedName(element.Parent)}"); 160if (element.Attribute("Name") is null) 174while (ancestorWithNameAttributeCandidate?.Attribute("Name") is null && ancestorWithNameAttributeCandidate?.Parent is not null) { 183idBuilder.Append(element.Attribute("Name") is not null ? AttributedName(element) : XmlName(element)); 220private static string? AttributedName(XElement element) => element.Attribute("Name")?.Value;
Model\XElementExtensions.cs (4)
40if (targetElement.Attribute("state") == null) 54transUnitElement.Element(Target)?.Attribute("state")?.Value 73XAttribute stateAttribute = targetElement.Attribute("state"); 136transUnitElement.Attribute("id").Value;
Model\XlfDocument.cs (1)
91XAttribute originalAttribute = fileElement.Attribute("original");
Tasks\TransformTemplates.cs (2)
86string projectFileFullPath = Path.Combine(templateDirectory, projectNode.Attribute("File").Value); 87File.Copy(TaskEnvironment.GetAbsolutePath(projectFileFullPath), TaskEnvironment.GetAbsolutePath(Path.Combine(localizedTemplateDirectory, Path.GetFileName(projectNode.Attribute("File").Value))), overwrite: true);
Microsoft.Extensions.FileProviders.Embedded (1)
Manifest\ManifestParser.cs (1)
128var value = element.Attribute("Name")?.Value;
Microsoft.Maui.Resizetizer (21)
GeneratePackageAppxManifest.cs (14)
92 var attr = identity.Attribute(xname); 103 var attr = identity.Attribute(xname); 201 var attr = visual.Attribute(xname); 209 var attr = visual.Attribute(xname); 218 var attr = visual.Attribute(xname); 228 var attr = visual.Attribute(xname); 240 var attr = visual.Attribute(xname); 264 var attr = tile.Attribute(xname); 276 var attr = tile.Attribute(xname); 288 var attr = tile.Attribute(xname); 302 var attr = tile.Attribute(xname); 319 if (showons.All(x => x.Attribute("Tile")?.Value != "square150x150Logo")) 321 if (showons.All(x => x.Attribute("Tile")?.Value != "wide310x150Logo")) 338 var attr = splash.Attribute(xname);
GenerateTizenManifest.cs (7)
145 if (icon.Attribute(DpiName) == null) 152 string dpiValue = icon.Attribute(DpiName).Value; 172 d => d.Attribute("type")?.Value == "img" 173 && d.Attribute(DpiName)?.Value == image.Key.Resolution 174 && d.Attribute("orientation")?.Value == image.Key.Orientation 175 && d.Attribute("indicator-display")?.Value == "false"); 192 var attr = element.Attribute(attrName);
Microsoft.NET.Build.Extensions.Tasks (3)
parent\Common\ConflictResolution\FrameworkListReader.cs (3)
68var type = file.Attribute("Type")?.Value; 75var assemblyName = file.Attribute("AssemblyName")?.Value; 76var assemblyVersionString = file.Attribute("Version")?.Value;
Microsoft.NET.Build.Tasks (26)
parent\Common\ConflictResolution\FrameworkListReader.cs (3)
68var type = file.Attribute("Type")?.Value; 75var assemblyName = file.Attribute("AssemblyName")?.Value; 76var assemblyVersionString = file.Attribute("Version")?.Value;
ResolveRuntimePackAssets.cs (11)
177string targetFrameworkVersion = frameworkListDoc.Root.Attribute("TargetFrameworkVersion")?.Value; 186(versionNumber >= 8 && frameworkListDoc.Root.Attribute("FrameworkName")?.Value == "Microsoft.Windows.SDK.NET.Ref")) 196var profileAttributeValue = fileElement.Attribute("Profile")?.Value; 207string pathAttributeValue = fileElement.Attribute("Path").Value; 212string typeAttributeValue = fileElement.Attribute("Type").Value; 230culture = fileElement.Attribute("Culture")?.Value; 233throw new BuildErrorException($"Culture not set in runtime manifest for {Path.GetFullPath(Path.Combine(runtimePack.GetMetadata(MetadataKeys.PackageDirectory), fileElement.Attribute("Path").Value))}"); 256assetItem.SetMetadata("AssemblyVersion", fileElement.Attribute("AssemblyVersion")?.Value); 257assetItem.SetMetadata("FileVersion", fileElement.Attribute("FileVersion")?.Value); 258assetItem.SetMetadata("PublicKeyToken", fileElement.Attribute("PublicKeyToken")?.Value); 259assetItem.SetMetadata("DropFromSingleFile", fileElement.Attribute("DropFromSingleFile")?.Value);
ResolveTargetingPackAssets.cs (10)
380var profileAttributeValue = fileElement.Attribute("Profile")?.Value; 396string referencedByDefaultAttributeValue = fileElement.Attribute("ReferencedByDefault")?.Value; 404string itemType = fileElement.Attribute("Type")?.Value; 407string assemblyName = fileElement.Attribute("AssemblyName").Value; 410Path.Combine(definition.TargetingPackRoot.OriginalValue, fileElement.Attribute("Path").Value) : 416item.SetMetadata("AssemblyVersion", fileElement.Attribute("AssemblyVersion").Value); 417item.SetMetadata("FileVersion", fileElement.Attribute("FileVersion").Value); 418item.SetMetadata("PublicKeyToken", fileElement.Attribute("PublicKeyToken").Value); 422string itemLanguage = fileElement.Attribute("Language")?.Value; 466string assemblyName = firstFileElement.Attribute("AssemblyName").Value;
StoreArtifactParser.cs (2)
31var pkgname = pkginfo.Attribute("Id"); 32var version = pkginfo.Attribute("Version");
Microsoft.NET.ProjectData (9)
FrameworkListExpander.cs (3)
84 string? type = (string?)file.Attribute("Type"); 85 string? path = (string?)file.Attribute("Path"); 96 string? language = (string?)file.Attribute("Language");
SdkKnownFrameworkReferenceResolver.cs (6)
89 string? targetFramework = (string?)element.Attribute("TargetFramework"); 90 string? targetingPackName = (string?)element.Attribute("TargetingPackName"); 91 string? targetingPackVersion = (string?)element.Attribute("TargetingPackVersion"); 105 string? targetFramework = (string?)element.Attribute("TargetFramework"); 106 string? packageId = (string?)element.Attribute("Include"); 107 string? packageVersion = (string?)element.Attribute(versionMetadataName);
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (3)
BlazorReadSatelliteAssemblyFile.cs (3)
28var taskItem = new TaskItem(e.Attribute("Name").Value); 29taskItem.SetMetadata("Culture", e.Attribute("Culture").Value); 30taskItem.SetMetadata("DestinationSubDirectory", e.Attribute("DestinationSubDirectory").Value);
Microsoft.NET.Sdk.Publish.Tasks (8)
WebConfigTransform.cs (8)
42.FirstOrDefault(e => string.Equals((string?)e.Attribute("name"), "aspnetcore", StringComparison.OrdinalIgnoreCase))? 43.Attribute("modules"); 68.FirstOrDefault(e => string.Equals((string?)e.Attribute("name"), "aspnetcore", StringComparison.OrdinalIgnoreCase)); 113var argumentsAttribute = aspNetCoreElement.Attribute("arguments"); 144var hostingModelAttributeValue = aspNetCoreElement.Attribute("hostingModel"); 198.FirstOrDefault(e => string.Equals((string?)e.Attribute("name"), "ASPNETCORE_ENVIRONMENT", StringComparison.OrdinalIgnoreCase)); 223element.SetAttributeValue(attributeName, (string?)element.Attribute(attributeName) ?? value); 228var arguments = (string?)aspNetCoreElement.Attribute("arguments");
Microsoft.NET.Sdk.StaticWebAssets.Tasks (4)
Legacy\GenerateV1StaticWebAssetsManifest.cs (4)
120if (!nodes.Exists(e => e.Attribute("BasePath").Value.Equals(normalizedBasePath, StringComparison.OrdinalIgnoreCase) && 121e.Attribute("Path").Value.Equals(normalizedContentRoot, StringComparison.OrdinalIgnoreCase))) 130return nodes.OrderBy(e => e.Attribute(BasePath).Value).ThenBy(e => e.Attribute(NodePath).Value);
Microsoft.TestPlatform.TestHostRuntimeProvider (2)
Hosting\AppxManifestFile.cs (1)
27Attribute("Executable")!.Value;
Hosting\DefaultTestHostManager.cs (1)
594Attribute("Include")!.Value;
NuGet.Configuration (12)
Settings\Items\FileClientCertItem.cs (3)
56var path = element.Attribute(XName.Get(ConfigurationConstants.PathAttribute))?.Value; 57var password = element.Attribute(XName.Get(ConfigurationConstants.PasswordAttribute))?.Value; 58var clearTextPassword = element.Attribute(XName.Get(ConfigurationConstants.ClearTextPasswordAttribute))?.Value;
Settings\Items\StoreClientCertItem.cs (4)
75var storeLocation = element.Attribute(XName.Get(ConfigurationConstants.StoreLocationAttribute))?.Value; 83var storeName = element.Attribute(XName.Get(ConfigurationConstants.StoreNameAttribute))?.Value; 91var findBy = element.Attribute(XName.Get(ConfigurationConstants.FindByAttribute))?.Value; 99var findValue = element.Attribute(XName.Get(ConfigurationConstants.FindValueAttribute))?.Value;
Settings\SettingElement.cs (3)
260var attribute = element.Attribute(requireAttribute); 274var attribute = element.Attribute(attributeValues.Key); 288var attribute = element.Attribute(attributeValues.Key);
Utility\XElementUtility.cs (2)
14var attr = element.Attribute(localName); 20var attr = element.Attribute(XName.Get(localName, namespaceName));
NuGet.PackageManagement (4)
Utility\XElementExtensions.cs (4)
23attr = element.Attribute(localName); 27attr = element.Attribute(XName.Get(localName, namespaceName)); 65where AttributeEquals(e, target.Attribute(e.Name)) 123var sourceAttribute = source.Attribute(targetAttribute.Name);
NuGet.Packaging (31)
Core\NuspecCoreReader.cs (2)
42var versionNode = node.Attribute(XName.Get(Version)); 51yield return new PackageDependency(node.Attribute(XName.Get(Id))!.Value, range);
Core\NuspecCoreReaderBase.cs (1)
104var node = MetadataNode.Attribute(XName.Get(MinClientVersion));
Core\NuspecUtility.cs (3)
73var nameAttribute = node.Attribute(XName.Get(Name)); 83var versionAttribute = node.Attribute(XName.Get(Version)); 182var attribute = element.Attribute(XName.Get(attributeName));
NuspecReader.cs (3)
440var type = licenseNode.Attribute(NuspecUtility.Type)?.Value?.Trim(); 442var versionValue = licenseNode.Attribute(NuspecUtility.Version)?.Value?.Trim(); 629var attribute = element.Attribute(XName.Get(attributeName));
PackageCreation\Authoring\ManifestReader.cs (16)
41manifestMetadata.MinClientVersionString = (string?)xElement.Attribute("minClientVersion"); 183var type = licenseNode.Attribute(NuspecUtility.Type)!.Value?.Trim(); 185var versionValue = licenseNode.Attribute(NuspecUtility.Version)?.Value?.Trim(); 252let includeAttribute = element.Attribute("include") 254let excludeAttribute = element.Attribute("exclude") 255let buildActionAttribute = element.Attribute("buildAction") 256let copyToOutputAttribute = element.Attribute("copyToOutput") 257let flattenAttribute = element.Attribute("flatten") 302.Select(element => ((string?)element.Attribute("file"))?.Trim()) 323let assemblyNameAttribute = element.Attribute("assemblyName") 388let idElement = element.Attribute("id") 411var srcElement = file.Attribute("src"); 435var repositoryType = element.Attribute("type"); 436var repositoryUrl = element.Attribute("url"); 437var repositoryBranch = element.Attribute("branch"); 438var repositoryCommit = element.Attribute("commit");
PackageCreation\Extensions\XElementExtensions.cs (3)
19attr = element.Attribute(localName); 23attr = element.Attribute(XName.Get(localName, namespaceName!)); 41where AttributeEquals(e, target.Attribute(e.Name))
PackagesConfigReader.cs (1)
108var node = _doc.Root!.Attribute(XName.Get(PackagesConfig.MinClientAttributeName));
PackagesConfigWriter.cs (1)
486var attribute = new XAttribute(name, newEntryNode.Attribute(name)!.Value);
Rules\InvalidUndottedFrameworkRule.cs (1)
281var attribute = element.Attribute(XName.Get(attributeName));
NuGet.Protocol (9)
LegacyFeed\LegacyFeedCapabilityResourceV2Feed.cs (5)
134let name = entitySet != null ? entitySet.Attribute("Name")?.Value : null 144var packageEntityTypeAttribute = result.EntitySet?.Attribute("EntityType"); 155select e.Attribute("Name")!.Value; 179let attribute = e.Attribute("Name") 189select e.Attribute("Name")!.Value;
LegacyFeed\V2FeedParser.cs (3)
340var downloadUrl = metadataCache.GetString(element.Element(_xnameContent)!.Attribute("src")!.Value); 631let attr = e.Attribute("rel") 633select e.Attribute("href") into nextLink
RemoteRepositories\RemoteV2FindPackageByIdResource.cs (1)
576ContentUri = element.Element(_xnameContent)!.Attribute("src")!.Value,
Roslyn.Diagnostics.Analyzers (19)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 148XAttribute? ruleId = ruleNode.Attribute(RuleIdAttributeName);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (4)
162var typeAttribute = element.Attribute(XmlAttribute_Type); 163var valueAttribute = element.Attribute(XmlAttribute_Value); 164var severityAttribute = element.Attribute(XmlAttribute_DiagnosticSeverity); 165var version = (int?)element.Attribute(XmlAttribute_SerializationVersion);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (6)
476id: Guid.Parse(namingStyleElement.Attribute(nameof(ID)).Value), 477name: namingStyleElement.Attribute(nameof(Name)).Value, 478prefix: namingStyleElement.Attribute(nameof(Prefix)).Value, 479suffix: namingStyleElement.Attribute(nameof(Suffix)).Value, 480wordSeparator: namingStyleElement.Attribute(nameof(WordSeparator)).Value, 481capitalizationScheme: (Capitalization)Enum.Parse(typeof(Capitalization), namingStyleElement.Attribute(nameof(CapitalizationScheme)).Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
399var serializationVersion = int.Parse(rootElement.Attribute("SerializationVersion")!.Value);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SerializableNamingRule.cs (3)
38EnforcementLevel = ((DiagnosticSeverity)Enum.Parse(typeof(DiagnosticSeverity), namingRuleElement.Attribute(nameof(EnforcementLevel))!.Value)).ToReportDiagnostic(), 39NamingStyleID = Guid.Parse(namingRuleElement.Attribute(nameof(NamingStyleID))!.Value), 40SymbolSpecificationID = Guid.Parse(namingRuleElement.Attribute(nameof(SymbolSpecificationID))!.Value)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
279id: Guid.Parse(symbolSpecificationElement.Attribute(nameof(ID)).Value), 280name: symbolSpecificationElement.Attribute(nameof(Name)).Value,
sdk-tasks (12)
GetDependencyInfo.cs (2)
35.FirstOrDefault(d => DependencyName.Equals(d.Attribute("Name")?.Value)); 39DependencyVersion = dependency.Attribute("Version")?.Value;
OverrideAndCreateBundledNETCoreAppPackageVersion.cs (10)
56.Select(e => e.Attribute("TargetFramework")?.Value) 70.Where(e => e.Name.LocalName == elementName && e.Attribute("TargetFramework")?.Value != latestTargetFramework) 75.Where(e => e.Name.LocalName == elementName && matchAttrs.All(attr => (e.Attribute(attr)?.Value ?? "") == (item2.Attribute(attr)?.Value ?? ""))) 79Log.LogError($"No matching {elementName} in stage 0 for: {string.Join(", ", matchAttrs.Select(a => $"{a}={item2.Attribute(a)?.Value}"))}"); 84Log.LogError($"Multiple matches for {elementName} in stage 0 for: {string.Join(", ", matchAttrs.Select(a => $"{a}={item2.Attribute(a)?.Value}"))}"); 90var v0 = item0.Attribute(updateAttr)?.Value; 91var v2 = item2.Attribute(updateAttr)?.Value; 119var v0 = item0.Attribute(attr.Name)?.Value; 121Log.LogMessage(MessageImportance.Low, $"{elementName} {string.Join(", ", matchAttrs.Select(a => $"{a}={item2.Attribute(a)?.Value}"))}: Metadata '{attr.Name}' differs: stage0='{v0}', stage2='{attr.Value}'");
System.ComponentModel.TypeConverter (1)
MS\Internal\Xml\Linq\ComponentModel\XComponentModel.cs (1)
155return _value = new XDeferredSingleton<XAttribute>((e, n) => e.Attribute(n), (component as XElement)!, null);
System.Private.CoreLib.Generators (21)
NativeRuntimeEventSourceGenerator.cs (21)
48.FirstOrDefault(e => (string)e.Attribute("name") == providerName); 161string? providerName = providerNode.Attribute("name")?.Value; 178string? eventName = eventNode.Attribute("symbol")?.Value; 186string? keywords = eventNode.Attribute("keywords")?.Value; 208string? name = keywordNode.Attribute("name")?.Value; 209string? mask = keywordNode.Attribute("mask")?.Value; 224string? providerName = providerNode.Attribute("name")?.Value; 244string? name = template.Attribute("tid")?.Value; 256string? eventName = eventNode.Attribute("symbol")?.Value; 263string? eventId = eventNode.Attribute("value")?.Value; 264string? version = eventNode.Attribute("version")?.Value; 276string? eventName = eventNode.Attribute("symbol")?.Value; 288string? eventId = eventNode.Attribute("value")?.Value; 289string? version = eventNode.Attribute("version")?.Value; 296string? level = eventNode.Attribute("level")?.Value; 298.Attribute("keywords") 316string? templateValue = eventNode.Attribute("template")?.Value; 330string? paramType = data.Attribute("inType")?.Value.ToString(); 337if (!string.IsNullOrEmpty(data.Attribute("count")?.Value)) 352string? paramType = data.Attribute("inType")?.Value; 353string? paramName = data.Attribute("name")?.Value;
System.Private.Xml.Linq (6)
System\Xml\Linq\XElement.cs (3)
1217XAttribute? a = Attribute(name); 1901if (Attribute(a.Name) != null) throw new InvalidOperationException(SR.InvalidOperation_DuplicateAttribute); 1908if (Attribute(a.Name) != null) throw new InvalidOperationException(SR.InvalidOperation_DuplicateAttribute);
System\Xml\Linq\XNodeReader.cs (2)
402XAttribute? a = e.Attribute(name); 428XAttribute? a = e.Attribute(name);
System\Xml\XPath\XNodeNavigator.cs (1)
854if (ce.Attribute(name) != null)