648 references to Attribute
aspire (54)
Packaging\NuGetConfigMerger.cs (36)
215var key = (string?)addElement.Attribute("key"); 216var value = (string?)addElement.Attribute("value"); 228.Select(e => (string?)e.Attribute("value") ?? string.Empty), StringComparer.OrdinalIgnoreCase); 230.Select(e => (string?)e.Attribute("key") ?? string.Empty), StringComparer.OrdinalIgnoreCase); 279var key = (string?)add.Attribute("key"); 280var value = (string?)add.Attribute("value"); 319var sourceKey = (string?)packageSourceElement.Attribute("key"); 330var pattern = (string?)packageElement.Attribute("pattern"); 404.FirstOrDefault(ps => string.Equals((string?)ps.Attribute("key"), keyToUse, StringComparison.OrdinalIgnoreCase)); 419.FirstOrDefault(p => string.Equals((string?)p.Attribute("pattern"), pattern, StringComparison.OrdinalIgnoreCase)); 445var pattern = (string?)packageElement.Attribute("pattern"); 467.FirstOrDefault(ps => string.Equals((string?)ps.Attribute("key"), keyToUse, StringComparison.OrdinalIgnoreCase)); 482.FirstOrDefault(p => string.Equals((string?)p.Attribute("pattern"), mapping.PackageFilter, StringComparison.OrdinalIgnoreCase)); 506var key = (string?)ps.Attribute("key"); 514var urlKey = (string?)elementToFix.Attribute("key"); 519.FirstOrDefault(ps => string.Equals((string?)ps.Attribute("key"), properKey, StringComparison.OrdinalIgnoreCase)); 528var pattern = (string?)packageToMove.Attribute("pattern"); 530.FirstOrDefault(p => string.Equals((string?)p.Attribute("pattern"), pattern, StringComparison.OrdinalIgnoreCase)); 566.Select(add => (string?)add.Attribute("key")) 574.Select(ps => (string?)ps.Attribute("key")) 589.FirstOrDefault(add => string.Equals((string?)add.Attribute("key"), sourceKey, StringComparison.OrdinalIgnoreCase)); 590var sourceValue = (string?)sourceElement?.Attribute("value"); 700var sourceKey = (string?)emptyElement.Attribute("key"); 716.FirstOrDefault(add => string.Equals((string?)add.Attribute("key"), sourceKey, StringComparison.OrdinalIgnoreCase) || 717string.Equals((string?)add.Attribute("value"), sourceKey, StringComparison.OrdinalIgnoreCase)); 761.Select(add => (string?)add.Attribute("key")) 768.Select(ps => (string?)ps.Attribute("key")) 781.FirstOrDefault(add => string.Equals((string?)add.Attribute("key"), sourceKey, StringComparison.OrdinalIgnoreCase)); 782var sourceValue = (string?)sourceElement?.Attribute("value"); 848.Select(e => (string?)e.Attribute("value") ?? string.Empty), StringComparer.OrdinalIgnoreCase); 850.Select(e => (string?)e.Attribute("key") ?? string.Empty), StringComparer.OrdinalIgnoreCase); 856var key = (string?)addElement.Attribute("key"); 857var value = (string?)addElement.Attribute("value"); 885var sourceKey = (string?)packageSourceElement.Attribute("key"); 894var pattern = (string?)packageElement.Attribute("pattern"); 982.FirstOrDefault(add => string.Equals((string?)add.Attribute("key"), "globalPackagesFolder", StringComparison.OrdinalIgnoreCase));
Packaging\PackageChannel.cs (1)
765.Select(element => element.Attribute("id")?.Value)
Projects\DotNetAppHostProject.cs (6)
377var projectAttributeValue = import.Attribute("Project")?.Value; 763var projectAttributeValue = import.Attribute("Project")?.Value; 1000var projectAttributeValue = import.Attribute("Project")?.Value; 1262var sdkAttribute = root.Attribute("Sdk")?.Value; 1276&& string.Equals(e.Attribute("Name")?.Value, AspireAppHostSdkName, StringComparison.OrdinalIgnoreCase)); 1291&& string.Equals(e.Attribute("Sdk")?.Value, AspireAppHostSdkName, StringComparison.OrdinalIgnoreCase));
Projects\FallbackProjectParser.cs (10)
166var sdkAttribute = projectRoot.Attribute("Sdk")?.Value; 179.FirstOrDefault(e => e.Attribute("Name")?.Value == "Aspire.AppHost.Sdk"); 181return sdkElement?.Attribute("Version")?.Value; 222.Where(e => !string.IsNullOrEmpty(e.Attribute("Include")?.Value) || !string.IsNullOrEmpty(e.Attribute("Update")?.Value)); 226var identity = element.Attribute("Include")?.Value ?? element.Attribute("Update")?.Value; 233var version = element.Attribute("Version")?.Value ?? 255.Where(e => !string.IsNullOrEmpty(e.Attribute("Include")?.Value)); 259var include = element.Attribute("Include")?.Value;
Projects\PrebuiltAppHostServer.cs (1)
501var include = element.Attribute("Include")?.Value;
Aspire.Cli.EndToEnd.Tests (7)
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)
267.Select(e => (string?)e.Attribute("value") ?? (string?)e.Attribute("key")) 278.Where(ps => ((string?)ps.Attribute("key"))?.Contains(feedFragment, StringComparison.OrdinalIgnoreCase) == true) 280.Any(p => string.Equals((string?)p.Attribute("pattern"), "Aspire*", StringComparison.OrdinalIgnoreCase));
Aspire.Cli.Tests (120)
AssemblyMetadataChannelTests.cs (1)
50(string?)e.Attribute("Condition"),
Commands\InitCommandTests.cs (3)
2166Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == channelSource); 2171.FirstOrDefault(ps => ps.Elements("package").Any(p => (string?)p.Attribute("pattern") == "Aspire*")); 2173Assert.Equal(channelSource, (string?)aspirePatternSource!.Attribute("key"));
Commands\NewCommandTests.cs (9)
731Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == sourceOverride); 732Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == PackageSources.NuGetOrg); 747.Where(e => string.Equals((string?)e.Attribute("key"), source, StringComparison.OrdinalIgnoreCase)) 749.Select(e => (string?)e.Attribute("pattern")) 1211.Any(package => (string?)package.Attribute("pattern") == "Aspire*")) 1212.Attribute("key"); 1216.Any(package => (string?)package.Attribute("pattern") == PackageMapping.AllPackages)) 1217.Attribute("key"); 2160.Select(element => (string)element.Attribute("value")!)
Packaging\NuGetConfigMergerTests.cs (58)
75Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://feed1.example"); 76Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://feed2.example"); 116Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://feed2.example"); 120Assert.NotNull(psm.Elements("packageSource").First().Elements("package").FirstOrDefault(p => (string?)p.Attribute("pattern") == "Aspire.*")); 156Assert.DoesNotContain(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://old.example"); 158Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://new.example"); 162Assert.Equal("https://new.example", (string?)psm.Element("packageSource")!.Attribute("key")); 163Assert.Equal("Lib.*", (string?)psm.Element("packageSource")!.Element("package")!.Attribute("pattern")); 199Assert.DoesNotContain(packageSources.Elements("add"), e => (string?)e.Attribute("value") == stagingSource); 200Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == stableSource); 203Assert.DoesNotContain(packageSourceMapping.Elements("packageSource"), e => (string?)e.Attribute("key") == "aspire-staging"); 206Assert.Equal(stableSource, (string?)stableMapping.Attribute("key")); 207Assert.Equal("Aspire.*", (string?)stableMapping.Element("package")!.Attribute("pattern")); 351Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("key") == "nuget" && (string?)e.Attribute("value") == "https://api.nuget.org/v3/index.json"); 352Assert.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"); 355Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://example.com/aspire-feed"); 359var nugetMapping = psm.Elements("packageSource").FirstOrDefault(ps => (string?)ps.Attribute("key") == "nuget"); 361Assert.Contains(nugetMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*"); 364var urlMapping = psm.Elements("packageSource").FirstOrDefault(ps => (string?)ps.Attribute("key") == "https://api.nuget.org/v3/index.json"); 401Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("key") == "nuget.org"); 402Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("key") == "custom"); 405Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://example.com/aspire-daily"); 417var aspireMapping = psm.Elements("packageSource").FirstOrDefault(ps => (string?)ps.Attribute("key") == "https://example.com/aspire-daily"); 419Assert.Contains(aspireMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "Aspire*"); 422var nugetMapping = psm.Elements("packageSource").FirstOrDefault(ps => (string?)ps.Attribute("key") == "nuget.org"); 424Assert.Contains(nugetMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*"); 426var customMapping = psm.Elements("packageSource").FirstOrDefault(ps => (string?)ps.Attribute("key") == "custom"); 428Assert.Contains(customMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*"); 470Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("key") == "nuget.org"); 473Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://example.com/aspire-daily"); 483var nugetMapping = psm.Elements("packageSource").FirstOrDefault(ps => (string?)ps.Attribute("key") == "nuget.org"); 485Assert.Contains(nugetMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*"); 488var aspireMapping = psm.Elements("packageSource").FirstOrDefault(ps => (string?)ps.Attribute("key") == "https://example.com/aspire-daily"); 490Assert.Contains(aspireMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "Aspire*"); 491Assert.Contains(aspireMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "Microsoft.Extensions.ServiceDiscovery*"); 535.FirstOrDefault(ps => (string?)ps.Attribute("key") == "nuget.org"); 537Assert.Contains(nugetMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*"); 541.FirstOrDefault(ps => (string?)ps.Attribute("key") == "github"); 543Assert.Contains(githubMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "myorg.*"); 544Assert.Contains(githubMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "other"); 545Assert.DoesNotContain(githubMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*"); 591e => (string?)e.Attribute("value") == "C:\\Users\\user\\.aspire\\hives\\invalid-pr"); 595e => (string?)e.Attribute("value") == "https://valid.example"); 599e => (string?)e.Attribute("value") == "https://api.nuget.org/v3/index.json"); 605ps => (string?)ps.Attribute("key") == "C:\\Users\\user\\.aspire\\hives\\invalid-pr"); 609.FirstOrDefault(ps => (string?)ps.Attribute("key") == "https://valid.example"); 611Assert.Contains(validExampleMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "ValidPkg*"); 612Assert.DoesNotContain(validExampleMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*"); 616.FirstOrDefault(ps => (string?)ps.Attribute("key") == "https://api.nuget.org/v3/index.json"); 618Assert.Contains(nugetMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "Aspire*"); 619Assert.Contains(nugetMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "Microsoft.Extensions.ServiceDiscovery*"); 620Assert.Contains(nugetMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*"); 672e => string.Equals((string?)e.Attribute("value"), oldHive, StringComparison.Ordinal)); 674e => string.Equals((string?)e.Attribute("value"), newHive, StringComparison.Ordinal)); 678ps => string.Equals((string?)ps.Attribute("key"), oldHive, StringComparison.Ordinal)); 722e => string.Equals((string?)e.Attribute("value"), oldHive, StringComparison.Ordinal));
Packaging\PackagingServiceTests.cs (2)
1134.FirstOrDefault(add => string.Equals((string?)add.Attribute("key"), "globalPackagesFolder", StringComparison.OrdinalIgnoreCase)); 1136var actualGlobalPackagesFolder = (string?)globalPackagesFolderAdd.Attribute("value");
Projects\AppHostServerProjectTests.cs (8)
156.FirstOrDefault(e => e.Attribute("Include")?.Value == "appsettings.json"); 159Assert.Equal("PreserveNewest", noneElement.Attribute("CopyToOutputDirectory")?.Value); 198element => element.Attribute("Include")?.Value == "Aspire.Hosting.Redis"); 200Assert.Equal("[13.1.0]", packageReference.Attribute("VersionOverride")?.Value); 201Assert.Null(packageReference.Attribute("Version")); 204element => element.Attribute("Include")?.Value == "Aspire.Hosting.PostgreSQL"); 226element => element.Attribute("Include")?.Value == integrationProjectPath); 231element => element.Attribute("Include")?.Value == "Aspire.Hosting.Redis");
Projects\PrebuiltAppHostServerTests.cs (26)
377Assert.Contains(packageElements, e => e.Attribute("Include")?.Value == "Aspire.Hosting" && e.Attribute("Version")?.Value == "13.2.0"); 378Assert.Contains(packageElements, e => e.Attribute("Include")?.Value == "Aspire.Hosting.Redis" && e.Attribute("Version")?.Value == "13.2.0"); 397Assert.Equal("/path/to/MyIntegration.csproj", projectElements[0].Attribute("Include")?.Value); 458.FirstOrDefault(element => element.Attribute("Name")?.Value == "_WriteAspireClosureManifest"); 461Assert.Equal("Build", target.Attribute("AfterTargets")?.Value); 462Assert.Equal("ResolveLockFileCopyLocalFiles", target.Attribute("DependsOnTargets")?.Value); 561Assert.Contains(packageElements, e => e.Attribute("Include")?.Value == "Aspire.Hosting.Redis" && e.Attribute("Version")?.Value == "[13.4.0-pr.17166.ga49d604d]"); 562Assert.Contains(packageElements, e => e.Attribute("Include")?.Value == "CommunityToolkit.Aspire.Hosting.Redis" && e.Attribute("Version")?.Value == "1.0.0"); 763.FirstOrDefault(a => string.Equals(a.Attribute("key")?.Value, "globalPackagesFolder", StringComparison.OrdinalIgnoreCase)); 765var gpfValue = gpf.Attribute("value")?.Value; 822.FirstOrDefault(a => string.Equals(a.Attribute("key")?.Value, "globalPackagesFolder", StringComparison.OrdinalIgnoreCase)); 824var gpfValue = gpf.Attribute("value")?.Value; 943.FirstOrDefault(a => string.Equals(a.Attribute("key")?.Value, "globalPackagesFolder", StringComparison.OrdinalIgnoreCase)); 947var gpfValue = gpf.Attribute("value")?.Value; 2154e.Attribute("Include")?.Value == "Aspire.Hosting.Redis" && 2155e.Attribute("Version")?.Value == "13.4.0-pr.17141.gf142085f"); 2281Assert.Contains(packageElements, e => e.Attribute("Include")?.Value == "Aspire.Hosting.Redis" && e.Attribute("Version")?.Value == "[13.4.0-pr.17166.ga49d604d]"); 2282Assert.Contains(packageElements, e => e.Attribute("Include")?.Value == "CommunityToolkit.Aspire.Hosting.Redis" && e.Attribute("Version")?.Value == "1.0.0"); 3014.Where(e => string.Equals(e.Attribute("key")?.Value, source, StringComparison.OrdinalIgnoreCase)) 3016.Select(e => e.Attribute("pattern")?.Value)
Templating\TemplateNuGetConfigServiceTests.cs (13)
62Assert.Contains(doc.Root!.Element("packageSources")!.Elements("add"), e => (string?)e.Attribute("value") == sourceOverride); 63Assert.Contains(doc.Root!.Element("packageSources")!.Elements("add"), e => (string?)e.Attribute("value") == PackageSources.NuGetOrg); 64Assert.DoesNotContain(doc.Descendants("add"), e => (string?)e.Attribute("value") == "https://private.example/v3/index.json"); 146Assert.Contains(doc.Root!.Element("packageSources")!.Elements("add"), e => (string?)e.Attribute("value") == "https://project.example/v3/index.json"); 147Assert.DoesNotContain(doc.Root!.Element("packageSources")!.Elements("add"), e => (string?)e.Attribute("value") == "https://parent.example/v3/index.json"); 335.Select(e => (string)e.Attribute("value")!) 394.Select(e => (string)e.Attribute("value")!) 515.Select(e => (string)e.Attribute("value")!) 1086.Where(e => string.Equals((string?)e.Attribute("key"), source, StringComparison.OrdinalIgnoreCase)) 1088.Select(e => (string?)e.Attribute("pattern")) 1127.Select(e => (string)e.Attribute("value")!) 1212.Select(e => (string)e.Attribute("value")!) 1270.Select(e => (string)e.Attribute("value")!)
Aspire.Dashboard (1)
Model\ResourceGraph\ResourceGraphMapper.cs (1)
96.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)
166var expectedPathData = XElement.Parse(icon.Content).Attribute("d")!.Value; 178var expectedPaths = iconContent.Elements().Select(e => e.Attribute("d")!.Value).ToArray();
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.RemoteHost (7)
AtsCapabilityScanner.cs (7)
3463.FirstOrDefault(m => string.Equals(m.Attribute("name")?.Value, memberName, StringComparison.Ordinal)); 3484.Select(param => param.Attribute("name")?.Value) 3528Name = param.Attribute("name")?.Value ?? string.Empty, 3611builder.Append(element.Attribute("name")?.Value); 3637var cref = element.Attribute("cref")?.Value; 3721var langword = element.Attribute("langword")?.Value; 3735var cref = element.Attribute("cref")?.Value;
dotnet (9)
Commands\Run\CSharpCompilerCommand.cs (3)
422if (file.Attribute("Type")?.Value.Equals(type, StringComparison.OrdinalIgnoreCase) != true) 427if (language is not null && file.Attribute("Language")?.Value.Equals(language, StringComparison.OrdinalIgnoreCase) != true) 432var filePath = file.Attribute("Path")?.Value;
ToolPackage\ToolConfigurationDeserializer.cs (6)
37Version = (string)root.Attribute("Version"), 42Name = (string)e.Attribute("Name"), 43EntryPoint = (string)e.Attribute("EntryPoint"), 44Runner = (string)e.Attribute("Runner"), 51RuntimeIdentifier = (string)e.Attribute("RuntimeIdentifier"), 52Id = (string)e.Attribute("Id"),
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)
475id: Guid.Parse(namingStyleElement.Attribute(nameof(ID)).Value), 476name: namingStyleElement.Attribute(nameof(Name)).Value, 477prefix: namingStyleElement.Attribute(nameof(Prefix)).Value, 478suffix: namingStyleElement.Attribute(nameof(Suffix)).Value, 479wordSeparator: namingStyleElement.Attribute(nameof(WordSeparator)).Value, 480capitalizationScheme: (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,
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 (11)
NuGetConfigTests.cs (6)
26element => (string?)element.Attribute("key") == "dotnet-tools"); 29(string?)source.Attribute("value")); 33element => (string?)element.Attribute("key") == "dotnet-tools"); 35.Select(element => element.Attribute("pattern")!.Value) 42element => (string?)element.Attribute("key") == "dotnet-public"); 44.Select(element => element.Attribute("pattern")!.Value);
Pipelines\NpmCliPackageTests.cs (5)
822(string?)element.Attribute("CollisionPriorityId") == collisionPriorityId && 823((string?)element.Attribute("Include") == include || (string?)element.Attribute("Update") == include) && 824(string?)element.Attribute("CertificateName") == certificateName && 825(string?)element.Attribute("Condition") == condition)
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)
3131string 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)
475id: Guid.Parse(namingStyleElement.Attribute(nameof(ID)).Value), 476name: namingStyleElement.Attribute(nameof(Name)).Value, 477prefix: namingStyleElement.Attribute(nameof(Prefix)).Value, 478suffix: namingStyleElement.Attribute(nameof(Suffix)).Value, 479wordSeparator: namingStyleElement.Attribute(nameof(WordSeparator)).Value, 480capitalizationScheme: (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)
475id: Guid.Parse(namingStyleElement.Attribute(nameof(ID)).Value), 476name: namingStyleElement.Attribute(nameof(Name)).Value, 477prefix: namingStyleElement.Attribute(nameof(Prefix)).Value, 478suffix: namingStyleElement.Attribute(nameof(Suffix)).Value, 479wordSeparator: namingStyleElement.Attribute(nameof(WordSeparator)).Value, 480capitalizationScheme: (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)
475id: Guid.Parse(namingStyleElement.Attribute(nameof(ID)).Value), 476name: namingStyleElement.Attribute(nameof(Name)).Value, 477prefix: namingStyleElement.Attribute(nameof(Prefix)).Value, 478suffix: namingStyleElement.Attribute(nameof(Suffix)).Value, 479wordSeparator: namingStyleElement.Attribute(nameof(WordSeparator)).Value, 480capitalizationScheme: (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)
475id: Guid.Parse(namingStyleElement.Attribute(nameof(ID)).Value), 476name: namingStyleElement.Attribute(nameof(Name)).Value, 477prefix: namingStyleElement.Attribute(nameof(Prefix)).Value, 478suffix: namingStyleElement.Attribute(nameof(Suffix)).Value, 479wordSeparator: namingStyleElement.Attribute(nameof(WordSeparator)).Value, 480capitalizationScheme: (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)
475id: Guid.Parse(namingStyleElement.Attribute(nameof(ID)).Value), 476name: namingStyleElement.Attribute(nameof(Name)).Value, 477prefix: namingStyleElement.Attribute(nameof(Prefix)).Value, 478suffix: namingStyleElement.Attribute(nameof(Suffix)).Value, 479wordSeparator: namingStyleElement.Attribute(nameof(WordSeparator)).Value, 480capitalizationScheme: (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)
60var flagsInt = child.Attribute("flagsInt"); 61var name = child.Attribute("name");
src\GenerateResxSource.cs (1)
108string 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)
555var source = element.Attribute(sourceAttr)?.Value; 606var id = element.Attribute(idAttr)?.Value;
src\GenerateMacOSDistributionFile.cs (3)
80.WithAttribute("id", c.Attribute("id").Value + ".alternate") 86.Select(c => new XElement("line", new XAttribute("choice", c.Attribute("id").Value))); 99if (optionsElement.Attribute("hostArchitectures") is null)
src\StabilizeWixFileId.cs (3)
73.Where(f => f.Attribute("Source")?.Value 86XAttribute nameAttribute = matchingFileElements[0].Attribute("Id"); 96matchingFileElements[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)
86var experimental = installationElement.Attribute("Experimental"); 95var 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)
271var name = packageType.Attribute("name"); 297string id = dependency.Attribute("id")?.Value; 303var 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)
86x.Attribute("Id")?.Value, 87x.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)
90XAttribute originalAttribute = fileElement.Attribute("original");
Tasks\TransformTemplates.cs (2)
85string projectFileFullPath = Path.Combine(templateDirectory, projectNode.Attribute("File").Value); 86File.Copy(projectFileFullPath, 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)
src\sdk\src\Tasks\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)
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;
src\sdk\src\Tasks\Common\ConflictResolution\FrameworkListReader.cs (3)
68var type = file.Attribute("Type")?.Value; 75var assemblyName = file.Attribute("AssemblyName")?.Value; 76var assemblyVersionString = file.Attribute("Version")?.Value;
StoreArtifactParser.cs (2)
31var pkgname = pkginfo.Attribute("Id"); 32var version = pkginfo.Attribute("Version");
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)
475id: Guid.Parse(namingStyleElement.Attribute(nameof(ID)).Value), 476name: namingStyleElement.Attribute(nameof(Name)).Value, 477prefix: namingStyleElement.Attribute(nameof(Prefix)).Value, 478suffix: namingStyleElement.Attribute(nameof(Suffix)).Value, 479wordSeparator: namingStyleElement.Attribute(nameof(WordSeparator)).Value, 480capitalizationScheme: (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)
41.Select(e => e.Attribute("TargetFramework")?.Value) 55.Where(e => e.Name.LocalName == elementName && e.Attribute("TargetFramework")?.Value != latestTargetFramework) 60.Where(e => e.Name.LocalName == elementName && matchAttrs.All(attr => (e.Attribute(attr)?.Value ?? "") == (item2.Attribute(attr)?.Value ?? ""))) 64Log.LogError($"No matching {elementName} in stage 0 for: {string.Join(", ", matchAttrs.Select(a => $"{a}={item2.Attribute(a)?.Value}"))}"); 69Log.LogError($"Multiple matches for {elementName} in stage 0 for: {string.Join(", ", matchAttrs.Select(a => $"{a}={item2.Attribute(a)?.Value}"))}"); 75var v0 = item0.Attribute(updateAttr)?.Value; 76var v2 = item2.Attribute(updateAttr)?.Value; 104var v0 = item0.Attribute(attr.Name)?.Value; 106Log.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)