295 instantiations of XElement
CustomEncryptorSample (3)
CustomXmlDecryptor.cs (1)
24return new XElement(encryptedElement.Elements().Single());
CustomXmlEncryptor.cs (2)
26var newElement = new XElement("unencryptedKey", 28new XElement(plaintextElement));
dotnet-svcutil-lib (15)
Shared\MSBuildProj.cs (14)
82_projectReferenceGroup = new XElement("ItemGroup"); 105_referenceGroup = new XElement("ItemGroup"); 129_packageReferenceGroup = new XElement("ItemGroup"); 453XElement propertyGroup = new XElement(group); 541this.ProjectReferceGroup.Add(new XElement("ProjectReference", new XAttribute("Include", dependency.FullPath))); 552this.ReferenceGroup.Add(new XElement("Reference", new XAttribute("Condition", $"'$(TargetFramework)' == '{netfxInfo.FullName}'"), new XAttribute("Include", dependency.AssemblyName), new XElement("HintPath", dependency.FullPath))); 557this.ReferenceGroup.Add(new XElement("Reference", new XAttribute("Include", dependency.AssemblyName), new XElement("HintPath", dependency.FullPath))); 561this.PacakgeReferenceGroup.Add(new XElement("PackageReference", new XAttribute("Include", dependency.Name), new XAttribute("Version", dependency.Version))); 564this.ReferenceGroup.Add(new XElement("DotNetCliToolReference", new XAttribute("Include", dependency.Name), new XAttribute("Version", dependency.Version))); 573this.ReferenceGroup.Add(new XElement("Content", new XAttribute("CopyToOutputDirectory", "always"), new XAttribute("Include", Path.Combine(dependency.FullPath.Substring(0, dependency.FullPath.LastIndexOf(Path.DirectorySeparatorChar)), "internalAssets\\**")), new XAttribute("Link", "internalAssets/%(RecursiveDir)%(Filename)%(Extension)"))); 577this.PacakgeReferenceGroup.Add(new XElement("Content", new XAttribute("CopyToOutputDirectory", "always"), new XAttribute("Include", path), new XAttribute("Link", "internalAssets/%(RecursiveDir)%(Filename)%(Extension)"))); 600XElement element = new XElement(propertyName, null);
Shared\Utilities\RuntimeEnvironmentHelper.cs (1)
100var addElement = new XElement("add");
dotnet-user-jwts (2)
src\Tools\Shared\SecretsHelpers\UserSecretsCreator.cs (2)
57propertyGroup = new XElement("PropertyGroup"); 63propertyGroup.Add(new XElement("UserSecretsId", newSecretsId));
dotnet-user-secrets (2)
src\Tools\Shared\SecretsHelpers\UserSecretsCreator.cs (2)
57propertyGroup = new XElement("PropertyGroup"); 63propertyGroup.Add(new XElement("UserSecretsId", newSecretsId));
IIS.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
269var rootApplication = new XElement(application);
src\Servers\IIS\IIS\test\Common.FunctionalTests\MultiApplicationTests.cs (1)
132var newApplication = new XElement(application);
IIS.LongTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
269var rootApplication = new XElement(application);
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (2)
1409new XElement("binding", 1412new XElement("binding",
IIS.NewHandler.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
269var rootApplication = new XElement(application);
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (2)
1409new XElement("binding", 1412new XElement("binding",
IIS.NewShim.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
269var rootApplication = new XElement(application);
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (2)
1409new XElement("binding", 1412new XElement("binding",
IIS.ShadowCopy.Tests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
269var rootApplication = new XElement(application);
IISExpress.FunctionalTests (4)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
269var rootApplication = new XElement(application);
src\Servers\IIS\IIS\test\Common.FunctionalTests\MultiApplicationTests.cs (1)
132var newApplication = new XElement(application);
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (2)
1409new XElement("binding", 1412new XElement("binding",
illink (7)
ILLink.Tasks (1)
CombineLinkerXmlFiles.cs (1)
30 var combined = new XElement ("linker");
Microsoft.AspNetCore.App.Analyzers.Test (4)
RouteEmbeddedLanguage\RoutePatternParserTests.cs (4)
249var element = new XElement("Tree", 265var parameterElement = new XElement("Parameter", 276parameterElement.Add(new XElement("Policy", policy)); 285new XElement("Diagnostic",
Microsoft.AspNetCore.Authentication.Test (7)
CookieTests.cs (3)
1890var xml = new XElement("xml"); 1893xml.Add(result.Ticket.Principal.Claims.Select(claim => new XElement("claim", new XAttribute("type", claim.Type), new XAttribute("value", claim.Value)))); 1897xml.Add(result.Ticket.Properties.Items.Select(extra => new XElement("extra", new XAttribute("type", extra.Key), new XAttribute("value", extra.Value))));
TestExtensions.cs (4)
49var xml = new XElement("xml"); 55new XElement("claim", new XAttribute("type", claim.Type), 68var xml = new XElement("xml"); 73xml.Add(new XElement("token", new XAttribute("name", token.Name),
Microsoft.AspNetCore.DataProtection (44)
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorDescriptor.cs (3)
43var encryptionElement = new XElement("encryption", 48: (object)new XElement("validation", 51var outerElement = new XElement("descriptor",
AuthenticatedEncryption\ConfigurationModel\CngCbcAuthenticatedEncryptorDescriptor.cs (3)
46var encryptionElement = new XElement("encryption", 54var hashElement = new XElement("hash", 61var rootElement = new XElement("descriptor",
AuthenticatedEncryption\ConfigurationModel\CngGcmAuthenticatedEncryptorDescriptor.cs (2)
45var encryptionElement = new XElement("encryption", 53var rootElement = new XElement("descriptor",
AuthenticatedEncryption\ConfigurationModel\ManagedAuthenticatedEncryptorDescriptor.cs (3)
45var encryptionElement = new XElement("encryption", 49var validationElement = new XElement("validation", 52var rootElement = new XElement("descriptor",
AuthenticatedEncryption\ConfigurationModel\SecretExtensions.cs (2)
37var masterKeyElement = new XElement("masterKey", 39new XElement("value", unprotectedSecretAsBase64String));
KeyManagement\XmlKeyManager.cs (12)
365var revocationElement = new XElement(RevocationElementName, 367new XElement(RevocationDateElementName, revocationDate), 369new XElement(KeyElementName, 371new XElement(ReasonElementName, reason)); 432var keyElement = new XElement(KeyElementName, 435new XElement(CreationDateElementName, creationDate), 436new XElement(ActivationDateElementName, activationDate), 437new XElement(ExpirationDateElementName, expirationDate), 540var revocationElement = new XElement(RevocationElementName, 542new XElement(RevocationDateElementName, revocationDate), 543new XElement(KeyElementName, 545new XElement(ReasonElementName, reason));
Repositories\EphemeralXmlRepository.cs (2)
41yield return new XElement(element); // makes a deep copy so caller doesn't inadvertently modify it 49var cloned = new XElement(element); // makes a deep copy so caller doesn't inadvertently modify it
XmlEncryption\CertificateXmlEncryptor.cs (1)
89xmlDocument.Load(new XElement("root", plaintextElement).CreateReader());
XmlEncryption\DpapiNGXmlEncryptor.cs (2)
85var element = new XElement("encryptedKey", 88new XElement("value",
XmlEncryption\DpapiXmlEncryptor.cs (2)
82var element = new XElement("encryptedKey", 84new XElement("value",
XmlEncryption\EncryptedXmlDecryptor.cs (1)
69xmlDocument.Load(new XElement("root", encryptedElement).CreateReader());
XmlEncryption\NullXmlDecryptor.cs (1)
31return new XElement(encryptedElement.Elements().Single());
XmlEncryption\NullXmlEncryptor.cs (2)
56var newElement = new XElement("unencryptedKey", 58new XElement(plaintextElement) /* copy ctor */);
XmlEncryption\XmlEncryptionExtensions.cs (7)
29var doc = new XDocument(new XElement(element)); 49var clonedElementWhichRequiresDecryption = new XElement(elementWhichRequiresDecryption); 56var newPlaceholder = new XElement("placeholder"); 111var doc = new XDocument(new XElement(element)); 130var clonedElementWhichRequiresEncryption = new XElement(elementWhichRequiresEncryption); 137var newPlaceholder = new XElement("placeholder"); 150new XElement(XmlConstants.EncryptedSecretElementName,
XmlExtensions.cs (1)
21var newElement = new XElement(element.Name);
Microsoft.AspNetCore.DataProtection.Tests (27)
Internal\KeyManagementOptionsPostSetupTest.cs (1)
17private static readonly XElement xElement = new("element");
KeyManagement\XmlKeyManagerTests.cs (10)
154new XElement("creationDate", creationDate), 155new XElement("activationDate", activationDate), 156new XElement("expirationDate", expirationDate)); 253new XElement("creationDate", creationDate), 254new XElement("activationDate", activationDate), 255new XElement("expirationDate", expirationDate)); 282new XElement("creationDate", creationDate), 283new XElement("activationDate", activationDate), 284new XElement("expirationDate", expirationDate)); 712new XElement("revocationDate", revocationDate));
Repositories\FileSystemXmlRepositoryTests.cs (3)
130repository.StoreElement(new XElement("element1"), friendlyName: null); 131repository.StoreElement(new XElement("element2"), friendlyName: null); 132repository.StoreElement(new XElement("element3"), friendlyName: null);
Repositories\RegistryXmlRepositoryTests.cs (3)
117repository.StoreElement(new XElement("element1"), friendlyName: null); 118repository.StoreElement(new XElement("element2"), friendlyName: null); 119repository.StoreElement(new XElement("element3"), friendlyName: null);
ServiceCollectionTests.cs (1)
99var xElement = new XElement("element");
XmlEncryption\EncryptedXmlDecryptorTests.cs (4)
20var data = new XElement("SampleData", "Lorem ipsum"); 38var data = new XElement("SampleData", "Lorem ipsum"); 56var data = new XElement("SampleData", "Lorem ipsum"); 78var data = new XElement("SampleData", "Lorem ipsum");
XmlEncryption\XmlEncryptionExtensionsTests.cs (5)
179.Returns<XElement>(el => new XElement(el.Name.LocalName + "_decrypted", new XElement(XmlConstants.EncryptedSecretElementName, "nested"))); 217mockXmlEncryptor.Setup(o => o.Encrypt(It.IsAny<XElement>())).Returns(new EncryptedXmlInfo(new XElement("theElement"), typeof(MyXmlDecryptor))); 265.Returns<XElement>(element => new EncryptedXmlInfo(new XElement(element.Name.LocalName + "_encrypted"), typeof(MyXmlDecryptor))); 314.Returns<XElement>(element => new EncryptedXmlInfo(new XElement(element), typeof(MyXmlDecryptor)));
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (3)
UnaryServerCallHandlerTests.cs (3)
1137var requestContent = new XDocument(new XElement("name", "World")).ToString(); 1291var requestContent = new XDocument(new XElement("name", "World")).ToString(); 1321var requestContent = new XDocument(new XElement("name", "World")).ToString();
Microsoft.AspNetCore.Http.Connections.Tests (2)
src\SignalR\common\Shared\EphemeralDataProtectionProvider.cs (2)
31 yield return new XElement(element); // makes a deep copy so caller doesn't inadvertently modify it 37 var cloned = new XElement(element); // makes a deep copy so caller doesn't inadvertently modify it
Microsoft.AspNetCore.Identity.InMemory.Test (3)
FunctionalTest.cs (3)
409var xml = new XElement("xml"); 412xml.Add(result.Principal.Claims.Select(claim => new XElement("claim", new XAttribute("type", claim.Type), new XAttribute("value", claim.Value)))); 416xml.Add(result.Properties.Items.Select(extra => new XElement("extra", new XAttribute("type", extra.Key), new XAttribute("value", extra.Value))));
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (1)
XmlAssert.cs (1)
70return new XElement(
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
src\Mvc\Mvc.Formatters.Xml\test\XmlAssert.cs (1)
70return new XElement(
Microsoft.AspNetCore.Rewrite (1)
IISUrlRewrite\UrlRewriteFileParser.cs (1)
28throw new InvalidUrlRewriteFormatException(new XElement(RewriteTags.Rewrite), "The root element '<rewrite>' is missing");
Microsoft.AspNetCore.Server.IntegrationTesting (2)
Deployers\RemoteWindowsDeployer\RemoteWindowsDeployer.cs (2)
169environmentVariablesSection = new XElement("environmentVariables"); 175var environmentVariable = new XElement("environmentVariable");
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (3)
XElementExtensions.cs (3)
26existing = new XElement(name); 38existing = new XElement(name, new XAttribute(attribute, attributeValue)); 47var innerElement = new XElement(name, new XAttribute(attribute, attributeValue));
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (2)
src\SignalR\common\Shared\EphemeralDataProtectionProvider.cs (2)
31 yield return new XElement(element); // makes a deep copy so caller doesn't inadvertently modify it 37 var cloned = new XElement(element); // makes a deep copy so caller doesn't inadvertently modify it
Microsoft.AspNetCore.SignalR.Tests (2)
src\SignalR\common\Shared\EphemeralDataProtectionProvider.cs (2)
31 yield return new XElement(element); // makes a deep copy so caller doesn't inadvertently modify it 37 var cloned = new XElement(element); // makes a deep copy so caller doesn't inadvertently modify it
Microsoft.Build.Tasks.Core (14)
AssemblyDependency\GenerateBindingRedirects.cs (6)
80runtimeNode = new XElement("runtime"); 91select new XElement( 93new XElement( 95new XElement( 100new XElement( 335new XElement("configuration"));
AssemblyDependency\ResolveAssemblyReference.cs (4)
1220var node = new XElement( 1222new XElement( 1224new XElement( 1227new XElement(
CombineTargetFrameworkInfoProperties.cs (3)
49new("TargetFramework", new XAttribute("Name", EscapingUtilities.Escape(RootElementName))) : 50new(RootElementName); 54root.Add(new XElement(item.ItemSpec, item.GetMetadata("Value")));
CombineXmlElements.cs (1)
36XElement root = new XElement(RootElementName);
Microsoft.Cci.Extensions (5)
Dgml\DgmlExtensions.cs (5)
31var xRoot = new XElement(XName.Get("DirectedGraph", dgmlNsp)); 34var xNodes = new XElement(XName.Get("Nodes", dgmlNsp)); 41var xNode = new XElement(XName.Get("Node", dgmlNsp), 47var xLinks = new XElement(XName.Get("Links", dgmlNsp)); 54var xLink = new XElement(XName.Get("Link", dgmlNsp),
Microsoft.DotNet.Arcade.Sdk (6)
src\GenerateResxSource.cs (1)
427string escapedTrimmedValue = new XElement("summary", value).ToString();
src\SourceBuild\AddSourceMappingToNugetConfig.cs (3)
58pkgSrcMappingClearElement = new XElement("clear"); 62var pkgSrc = new XElement("packageSource", new XAttribute("key", SourceName)); 65pkgSrc.Add(new XElement("package", new XAttribute("pattern", packagePattern)));
src\SourceBuild\AddSourceToNuGetConfig.cs (2)
43var sourceElementToAdd = new XElement( 71packageSourcesElement.AddFirst(new XElement("clear"));
Microsoft.DotNet.Build.Tasks.Installers (10)
src\GenerateMacOSDistributionFile.cs (10)
41var titleElement = new XElement("title", $"{ProductBrandName} ({TargetArchitecture})"); 62var scriptElement = new XElement("script", new XCData(archScriptContent)); 65.Select(component => new XElement("choice", 70new XElement("pkg-ref", new XAttribute("id", component.GetMetadata("FileNameWithExtension"))))); 77choiceElements.Select(c => new XElement(c) 80choiceElements.Select(c => new XElement(c) 87.Select(c => new XElement("line", new XAttribute("choice", c.Attribute("id").Value))); 90.Select(component => new XElement("pkg-ref", 98optionsElement = new XElement("options"); 116document.Root.Add(new XElement("choices-outline", choiceLineElements));
Microsoft.DotNet.Build.Tasks.Workloads (6)
Msi\MsiPayloadPackageProject.wix.cs (1)
61itemGroup.Add(new XElement("None",
Msi\WorkloadPackGroupMsi.wix.cs (5)
95componentGroupRefElement.ReplaceWith(Enumerable.Range(1, _package.Packs.Count).Select(n => new XElement(ns + "ComponentGroupRef", new XAttribute("Id", "CG_PackageContents" + n)))); 105registryKeyElement.Add(new XElement(ns + "RegistryKey", new XAttribute("Key", pack.Id), 106new XElement(ns + "RegistryKey", new XAttribute("Key", pack.PackageVersion), 107new XElement(ns + "RegistryValue", new XAttribute("Value", ""), new XAttribute("Type", "string"))))); 184var xml = new XElement(ns + "Directory");
Microsoft.DotNet.PackageTesting (9)
VerifyClosure.cs (9)
346var doc = new XDocument(new XElement(s_dgmlns + "DirectedGraph")); 347var nodesElement = new XElement(s_dgmlns + "Nodes"); 348var linksElement = new XElement(s_dgmlns + "Links"); 360linksElement.Add(new XElement(s_dgmlns + "Link", 369linksElement.Add(new XElement(s_dgmlns + "Link", 377var categoriesElement = new XElement(s_dgmlns + "Categories"); 380categoriesElement.Add(new XElement(s_dgmlns + "Category", 385categoriesElement.Add(new XElement(s_dgmlns + "Category", 400parent.Add(new XElement(s_dgmlns + "Node",
Microsoft.DotNet.SharedFramework.Sdk (11)
src\CreateFrameworkListFile.cs (2)
67var frameworkManifest = new XElement("FileList", rootAttributes); 158var element = new XElement(
src\Microsoft.DotNet.PackageTesting\VerifyClosure.cs (9)
346var doc = new XDocument(new XElement(s_dgmlns + "DirectedGraph")); 347var nodesElement = new XElement(s_dgmlns + "Nodes"); 348var linksElement = new XElement(s_dgmlns + "Links"); 360linksElement.Add(new XElement(s_dgmlns + "Link", 369linksElement.Add(new XElement(s_dgmlns + "Link", 377var categoriesElement = new XElement(s_dgmlns + "Categories"); 380categoriesElement.Add(new XElement(s_dgmlns + "Category", 385categoriesElement.Add(new XElement(s_dgmlns + "Category", 400parent.Add(new XElement(s_dgmlns + "Node",
Microsoft.DotNet.SourceBuild.Tasks (15)
src\UsageReport\AnnotatedUsage.cs (1)
19public XElement ToXml() => new XElement(
src\UsageReport\Usage.cs (1)
30public XElement ToXml() => new XElement(
src\UsageReport\UsageData.cs (7)
18public XElement ToXml() => new XElement( 20CreatedByRid == null ? null : new XElement( 23ProjectDirectories?.Any() != true ? null : new XElement( 26.Select(dir => new XElement("Dir", dir))), 27NeverRestoredTarballPrebuilts?.Any() != true ? null : new XElement( 32IgnorePatterns?.Any() != true ? null : new XElement( 36Usages?.Any() != true ? null : new XElement(
src\UsageReport\UsagePattern.cs (1)
15public XElement ToXml() => new XElement(
src\UsageReport\ValidateUsageAgainstBaseline.cs (3)
84var report = new XElement("BaselineComparison"); 98new XElement( 112report.Add(new XElement("Removed", diff.Removed.Select(id => id.ToXElement())));
src\UsageReport\WriteUsageReports.cs (1)
107var report = new XElement("AnnotatedUsages");
src\UsageReport\XmlParsingHelpers.cs (1)
15public static XElement ToXElement(this PackageIdentity ident) => new XElement(
Microsoft.DotNet.VersionTools (12)
BuildManifest\Model\BlobArtifactModel.cs (1)
97public XElement ToXml() => new XElement(
BuildManifest\Model\BuildIdentity.cs (1)
163public XElement ToXmlBuildElement() => new XElement("Build", ToXmlAttributes());
BuildManifest\Model\BuildModel.cs (1)
28public XElement ToXml() => new XElement(
BuildManifest\Model\EndpointModel.cs (1)
49public XElement ToXml() => new XElement(
BuildManifest\Model\OrchestratedBuildModel.cs (1)
42public XElement ToXml() => new XElement(
BuildManifest\Model\PackageArtifactModel.cs (1)
115public XElement ToXml() => new XElement(
BuildManifest\Model\SigningInformationModel.cs (6)
35public XElement ToXml() => IsEmpty() ? null : new XElement( 101public XElement ToXml() => new XElement( 150public XElement ToXml() => new XElement( 186public XElement ToXml() => new XElement( 216public XElement ToXml() => new XElement( 257public XElement ToXml() => new XElement(
Microsoft.DotNet.XliffTasks (10)
Model\XElementExtensions.cs (3)
35targetElement = new XElement(Target, new XAttribute("state", "new")); 69targetElement = new XElement(Target); 122noteElement = new XElement(Note);
Model\XlfDocument.cs (7)
49new XElement(Xliff, 54new XElement(File, 59new XElement(Body)))); 188new(TransUnit, 190new XElement(Source, sourceNode.Source), 191new XElement(Target, new XAttribute("state", "new"), sourceNode.Source), 192new XElement(Note, sourceNode.Note == "" ? null : sourceNode.Note));
Microsoft.Extensions.FileProviders.Embedded.Tests (6)
Manifest\TestEntry.cs (3)
24new XElement("File", new XAttribute("Name", Name), new XElement("ResourcePath", ResourcePath)) : 25new XElement("Directory", new XAttribute("Name", Name), Children.Select(c => c.ToXElement()));
TestAssembly.cs (3)
34new XElement("Manifest", 35new XElement("ManifestVersion", "1.0"), 36new XElement("FileSystem", entry.Children.Select(c => c.ToXElement()))));
PresentationFramework-SystemXmlLinq (1)
SystemXmlLinqExtension.cs (1)
21XElement xelement = new XElement("Dummy");
SignalR.Client.FunctionalTestApp (2)
src\SignalR\common\Shared\EphemeralDataProtectionProvider.cs (2)
31 yield return new XElement(element); // makes a deep copy so caller doesn't inadvertently modify it 37 var cloned = new XElement(element); // makes a deep copy so caller doesn't inadvertently modify it
System.Private.DataContractSerialization (1)
System\Runtime\Serialization\XmlDataContract.cs (1)
373o = new System.Xml.Linq.XElement("default");
System.Private.Xml.Linq (14)
System\Xml\Linq\XContainer.cs (6)
164AddNode(new XElement(x)); 491AddNodeSkipNotify(new XElement(x)); 906XElement e = new XElement(_eCache.Get(r.NamespaceURI).GetName(r.LocalName)); 960XElement e = new XElement(_eCache.Get(r.NamespaceURI).GetName(r.LocalName)); 1020XElement e = new XElement(_eCache.Get(r.NamespaceURI).GetName(r.LocalName)); 1134XElement e = new XElement(_eCache.Get(r.NamespaceURI).GetName(r.LocalName));
System\Xml\Linq\XElement.cs (5)
164XElement xe = new XElement(default(AsyncConstructionSentry)); 812XElement e = new XElement(reader, options); 848XElement e = new XElement(default(AsyncConstructionSentry)); 1270AddNode(new XElement(name, GetStringValue(value))); 1955return new XElement(this);
System\Xml\Linq\XLinq.cs (1)
95AddNode(new XElement(x));
System\Xml\Linq\XNode.cs (1)
444return new XElement(reader);
System\Xml\Linq\XNodeBuilder.cs (1)
183AddNode(new XElement(XNamespace.Get(namespaceName!).GetName(localName)));
WorkloadBuildTasks (4)
PatchNuGetConfig.cs (4)
97var newPackageSourceElement = new XElement("add", 118packageSourceMapping = new XElement("packageSourceMapping"); 122var newPackageSourceMappingElement = new XElement("packageSource", 125(pattern => new XElement("package", new XAttribute("pattern", pattern))));
XmlFileLogger (19)
LogProcessNode.cs (2)
128var propElement = new XElement("Properties"); 131propElement.Add(new XElement("Property", new XAttribute("Name", p.Key)) { Value = p.Value });
ObjectModel\Build.cs (2)
47var root = new XElement("Build", 66WriteChildren<Message>(parentElement, () => new XElement("BuildMessageEvents"));
ObjectModel\Item.cs (2)
71var element = new XElement("Item"); 79var metadataElement = new XElement(metadataItem.Key);
ObjectModel\Message.cs (1)
36element.Add(new XElement("Message", new XAttribute("Timestamp", _timestamp), new XText(_message)));
ObjectModel\Project.cs (2)
98var element = new XElement("Project", 107WriteChildren<Message>(element, () => new XElement("ProjectMessageEvents"));
ObjectModel\Target.cs (3)
35var element = new XElement("Target", 43WriteChildren<Message>(element, () => new XElement("TargetMessages")); 44WriteChildren<ItemGroup>(element, () => new XElement("ItemGroups"));
ObjectModel\Task.cs (6)
49var task = new XElement("Task", 56WriteChildren<Message>(task, () => new XElement("TaskMessages")); 57WriteChildren<InputParameter>(task, () => new XElement("Parameters")); 58WriteChildren<OutputItem>(task, () => new XElement("OutputItems")); 59WriteChildren<OutputProperty>(task, () => new XElement("OutputProperties")); 63task.Add(new XElement("CommandLineArguments") { Value = CommandLineArguments });
ObjectModel\TaskParameter.cs (1)
46XElement element = new XElement(name);
xunit.console (2)
ConsoleRunner.cs (2)
281assembliesElement = new XElement("assemblies"); 334var assemblyElement = needsXml ? new XElement("assembly") : null;
1574 references to XElement
CustomEncryptorSample (4)
CustomXmlDecryptor.cs (2)
20public XElement Decrypt(XElement encryptedElement)
CustomXmlEncryptor.cs (2)
20public EncryptedXmlInfo Encrypt(XElement plaintextElement) 26var newElement = new XElement("unencryptedKey",
dotnet-svcutil-lib (47)
Shared\MSBuildProj.cs (45)
69private XElement ProjectNode { get; set; } 71private XElement _projectReferenceGroup; 72private XElement ProjectReferceGroup 78IEnumerable<XElement> refItems = this.ProjectNode.Elements("ProjectReference"); 94private XElement _referenceGroup; 95private XElement ReferenceGroup 101IEnumerable<XElement> refItems = this.ProjectNode.Elements("Reference"); 118private XElement _packageReferenceGroup; 119private XElement PacakgeReferenceGroup 125IEnumerable<XElement> refItems = this.ProjectNode.Elements("PackageReference"); 198IEnumerable<XElement> targetFrameworkElements = GetSubGroupValues(msbuildProj.ProjectNode, msbuildNS, "PropertyGroup", "TargetFramework"); 220IEnumerable<XElement> targetFrameworksElements = GetSubGroupValues(msbuildProj.ProjectNode, msbuildNS, "PropertyGroup", "TargetFrameworks"); 254IEnumerable<XElement> runtimeIdentifierElements = GetSubGroupValues(msbuildProj.ProjectNode, msbuildNS, "PropertyGroup", "RuntimeIdentifier"); 260IEnumerable<XElement> packageReferenceElements = GetSubGroupValues(msbuildProj.ProjectNode, msbuildNS, "ItemGroup", "PackageReference"); 261foreach (XElement reference in packageReferenceElements) 277IEnumerable<XElement> toolReferenceElements = GetSubGroupValues(msbuildProj.ProjectNode, msbuildNS, "ItemGroup", "DotNetCliToolReference"); 278foreach (XElement reference in toolReferenceElements) 290IEnumerable<XElement> projectReferenceElements = GetSubGroupValues(msbuildProj.ProjectNode, msbuildNS, "ItemGroup", "ProjectReference"); 291foreach (XElement reference in projectReferenceElements) 300IEnumerable<XElement> binReferenceElements = GetSubGroupValues(msbuildProj.ProjectNode, msbuildNS, "ItemGroup", "Reference"); 301foreach (XElement reference in binReferenceElements) 311XElement hintPath = reference.Element("HintPath"); 312XElement path = reference.Element("Path"); 432var ele = doc.Root?.Descendants(elementStr).FirstOrDefault(); 445private static IEnumerable<XElement> GetGroupValues(XElement projectElement, string group, bool createOnMissing = false) 448IEnumerable<XElement> groups = projectElement.Elements(group); 453XElement propertyGroup = new XElement(group); 455return new XElement[] { propertyGroup }; 462private static IEnumerable<XElement> GetSubGroupValues(XElement projectElement, XNamespace msbuildNS, string group, string subGroupName) 464IEnumerable<XElement> groups = GetGroupValues(projectElement, group); 465IEnumerable<XElement> subGroupValues = groups.Elements(msbuildNS + subGroupName); 469private static string GetItemValue(XElement reference, string itemName, bool throwIfMissing = false) 478XElement itemNameElement = null; 492public static bool TryGetItemIdentity(XElement itemName, out string itemIdentity) 506private static string GetItemIdentity(XElement itemName) 600XElement element = new XElement(propertyName, null); 602IEnumerable<XElement> existingElements = GetSubGroupValues(this.ProjectNode, _msbuildNS, "PropertyGroup", propertyName); 609IEnumerable<XElement> propertyGroupItems = GetGroupValues(this.ProjectNode, "PropertyGroup", createOnMissing: true); 610XElement propertyGroup = propertyGroupItems.First(); 659IEnumerable<XElement> targetFrameworkElements = GetSubGroupValues(this.ProjectNode, _msbuildNS, "PropertyGroup", "TargetFramework"); 662var targetFrameworkNode = targetFrameworkElements.Last(); 667IEnumerable<XElement> targetFrameworksElements = GetSubGroupValues(this.ProjectNode, _msbuildNS, "PropertyGroup", "TargetFrameworks"); 670var targetFrameworksNode = targetFrameworksElements.Last();
Shared\Utilities\RuntimeEnvironmentHelper.cs (2)
82var pkgSourcesNode = doc.Element("configuration")?.Element("packageSources"); 100var addElement = new XElement("add");
dotnet-user-jwts (4)
src\Tools\Shared\SecretsHelpers\UserSecretsCreator.cs (4)
31var existingUserSecretsId = projectDocument.XPathSelectElements("//UserSecretsId").FirstOrDefault(); 48var propertyGroup = projectDocument.Root.DescendantNodes() 49.FirstOrDefault(node => node is XElement el 52attr.Name != "Condition")) as XElement;
dotnet-user-secrets (4)
src\Tools\Shared\SecretsHelpers\UserSecretsCreator.cs (4)
31var existingUserSecretsId = projectDocument.XPathSelectElements("//UserSecretsId").FirstOrDefault(); 48var propertyGroup = projectDocument.Root.DescendantNodes() 49.FirstOrDefault(node => node is XElement el 52attr.Name != "Condition")) as XElement;
IIS.FunctionalTests (16)
src\Servers\IIS\IIS\test\Common.FunctionalTests\FrebTests.cs (4)
152var xDocument = XDocument.Load(xmlFile).Root; 155foreach (var eventElement in eventElements) 157var eventElementWithOpCode = eventElement.Descendants(nameSpace + "RenderingInfo").Single().Descendants(nameSpace + "Opcode").Single(); 158var requestStatus = eventElement.Element(nameSpace + "EventData").Descendants().Where(el => el.Attribute("Name").Value == "requestStatus").SingleOrDefault();
src\Servers\IIS\IIS\test\Common.FunctionalTests\GlobalVersionTests.cs (2)
239.OfType<XElement>() 248foreach (var element in moduleNodes)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (5)
97public static void ModifyWebConfig(this DeploymentResult deploymentResult, Action<XElement> action) 254public static string CreateEmptyApplication(XElement config, string contentRoot) 256var siteElement = config 261var application = siteElement 269var rootApplication = new XElement(application);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISCompressionSiteFixture.cs (1)
27var webServerElement = element
src\Servers\IIS\IIS\test\Common.FunctionalTests\MultiApplicationTests.cs (4)
112private void DuplicateApplication(XElement config, string contentRoot) 114var siteElement = config 119var application = siteElement 132var newApplication = new XElement(application);
IIS.LongTests (10)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (5)
97public static void ModifyWebConfig(this DeploymentResult deploymentResult, Action<XElement> action) 254public static string CreateEmptyApplication(XElement config, string contentRoot) 256var siteElement = config 261var application = siteElement 269var rootApplication = new XElement(application);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISCompressionSiteFixture.cs (1)
27var webServerElement = element
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (4)
317var ancmElement = element 548private static Dictionary<string, (string, Action<XElement>)> InvalidConfigTransformations = InitInvalidConfigTransformations(); 572public static Dictionary<string, (string, Action<XElement>)> InitInvalidConfigTransformations() 574var dictionary = new Dictionary<string, (string, Action<XElement>)>();
IIS.NewHandler.FunctionalTests (10)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (5)
97public static void ModifyWebConfig(this DeploymentResult deploymentResult, Action<XElement> action) 254public static string CreateEmptyApplication(XElement config, string contentRoot) 256var siteElement = config 261var application = siteElement 269var rootApplication = new XElement(application);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISCompressionSiteFixture.cs (1)
27var webServerElement = element
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (4)
317var ancmElement = element 548private static Dictionary<string, (string, Action<XElement>)> InvalidConfigTransformations = InitInvalidConfigTransformations(); 572public static Dictionary<string, (string, Action<XElement>)> InitInvalidConfigTransformations() 574var dictionary = new Dictionary<string, (string, Action<XElement>)>();
IIS.NewShim.FunctionalTests (10)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (5)
97public static void ModifyWebConfig(this DeploymentResult deploymentResult, Action<XElement> action) 254public static string CreateEmptyApplication(XElement config, string contentRoot) 256var siteElement = config 261var application = siteElement 269var rootApplication = new XElement(application);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISCompressionSiteFixture.cs (1)
27var webServerElement = element
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (4)
317var ancmElement = element 548private static Dictionary<string, (string, Action<XElement>)> InvalidConfigTransformations = InitInvalidConfigTransformations(); 572public static Dictionary<string, (string, Action<XElement>)> InitInvalidConfigTransformations() 574var dictionary = new Dictionary<string, (string, Action<XElement>)>();
IIS.ShadowCopy.Tests (6)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (5)
97public static void ModifyWebConfig(this DeploymentResult deploymentResult, Action<XElement> action) 254public static string CreateEmptyApplication(XElement config, string contentRoot) 256var siteElement = config 261var application = siteElement 269var rootApplication = new XElement(application);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISCompressionSiteFixture.cs (1)
27var webServerElement = element
IIS.Tests (2)
Utilities\TestServer.cs (2)
129var siteElement = webHostConfig.Root 134var binding = siteElement
IISExpress.FunctionalTests (20)
src\Servers\IIS\IIS\test\Common.FunctionalTests\FrebTests.cs (4)
152var xDocument = XDocument.Load(xmlFile).Root; 155foreach (var eventElement in eventElements) 157var eventElementWithOpCode = eventElement.Descendants(nameSpace + "RenderingInfo").Single().Descendants(nameSpace + "Opcode").Single(); 158var requestStatus = eventElement.Element(nameSpace + "EventData").Descendants().Where(el => el.Attribute("Name").Value == "requestStatus").SingleOrDefault();
src\Servers\IIS\IIS\test\Common.FunctionalTests\GlobalVersionTests.cs (2)
239.OfType<XElement>() 248foreach (var element in moduleNodes)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (5)
97public static void ModifyWebConfig(this DeploymentResult deploymentResult, Action<XElement> action) 254public static string CreateEmptyApplication(XElement config, string contentRoot) 256var siteElement = config 261var application = siteElement 269var rootApplication = new XElement(application);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISCompressionSiteFixture.cs (1)
27var webServerElement = element
src\Servers\IIS\IIS\test\Common.FunctionalTests\MultiApplicationTests.cs (4)
112private void DuplicateApplication(XElement config, string contentRoot) 114var siteElement = config 119var application = siteElement 132var newApplication = new XElement(application);
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (4)
317var ancmElement = element 548private static Dictionary<string, (string, Action<XElement>)> InvalidConfigTransformations = InitInvalidConfigTransformations(); 572public static Dictionary<string, (string, Action<XElement>)> InitInvalidConfigTransformations() 574var dictionary = new Dictionary<string, (string, Action<XElement>)>();
illink (2)
ILLink.Tasks (2)
CombineLinkerXmlFiles.cs (2)
30 var combined = new XElement ("linker"); 34 foreach (var element in subFile.Root.Elements ()) {
KeyManagementSimulator (9)
Program.cs (9)
234private static readonly XElement serializedDescriptor = XElement.Parse(@" 259IAuthenticatedEncryptorDescriptor IAuthenticatedEncryptorDescriptorDeserializer.ImportFromXml(XElement element) => descriptor; 523private readonly List<XElement> _elements = new(); 530IReadOnlyCollection<XElement> IXmlRepository.GetAllElements() 538void IXmlRepository.StoreElement(XElement element, string _friendlyName) 557EncryptedXmlInfo IXmlEncryptor.Encrypt(XElement plaintextElement) 576XElement IXmlDecryptor.Decrypt(XElement encryptedElement)
Microsoft.AspNetCore.App.Analyzers.Test (9)
RouteEmbeddedLanguage\RoutePatternParserTests.cs (9)
197var expectedDiagnostics = CreateDiagnosticsElement(sourceText, tree); 249var element = new XElement("Tree", 263private static XElement CreateParameter(RouteParameter parameter) 265var parameterElement = new XElement("Parameter", 282private static XElement CreateDiagnosticsElement(SourceText text, RoutePatternTree tree) 293private static XElement NodeToElement(RoutePatternNode node) 295var element = new XElement(node.Kind.ToString()); 304private static XElement TokenToElement(RoutePatternToken token) 306var element = new XElement(token.Kind.ToString());
Microsoft.AspNetCore.App.UnitTests (1)
TargetingPackTests.cs (1)
315void CompareFrameworkElements(HashSet<string> expectedAssemblyNames, IEnumerable<XElement> actualElements, string type)
Microsoft.AspNetCore.Authentication.Test (26)
CertificateTests.cs (11)
468XElement responseAsXml = null; 474responseAsXml = XElement.Parse(responseContent); 599XElement responseAsXml = null; 605responseAsXml = XElement.Parse(responseContent); 624responseAsXml = XElement.Parse(responseContent); 669XElement responseAsXml = null; 675responseAsXml = XElement.Parse(responseContent); 726XElement responseAsXml = null; 732responseAsXml = XElement.Parse(responseContent); 751responseAsXml = XElement.Parse(responseContent); 773responseAsXml = XElement.Parse(responseContent);
CookieTests.cs (5)
1754var claim = transaction.ResponseElement.Elements("claim").SingleOrDefault(elt => elt.Attribute("type").Value == claimType); 1764var property = transaction.ResponseElement.Elements("extra").SingleOrDefault(elt => elt.Attribute("type").Value == key); 1890var xml = new XElement("xml"); 1929transaction.ResponseElement = XElement.Parse(transaction.ResponseText); 1943public XElement ResponseElement { get; set; }
JwtBearerTests.cs (1)
1268transaction.ResponseElement = XElement.Parse(transaction.ResponseText);
JwtBearerTests_Handler.cs (1)
1300transaction.ResponseElement = XElement.Parse(transaction.ResponseText);
OpenIdConnect\TestServerExtensions.cs (1)
45transaction.ResponseElement = XElement.Parse(transaction.ResponseText);
OpenIdConnect\TestTransaction.cs (1)
19public XElement ResponseElement { get; set; }
TestExtensions.cs (3)
40transaction.ResponseElement = XElement.Parse(transaction.ResponseText); 49var xml = new XElement("xml"); 68var xml = new XElement("xml");
Transaction.cs (3)
17public XElement ResponseElement { get; set; } 38var claim = ResponseElement.Elements("claim") 50var claim = ResponseElement.Elements("token")
Microsoft.AspNetCore.CookiePolicy.Test (3)
TestExtensions.cs (1)
37transaction.ResponseElement = XElement.Parse(transaction.ResponseText);
Transaction.cs (2)
18public XElement ResponseElement { get; set; } 39var claim = ResponseElement.Elements("claim")
Microsoft.AspNetCore.DataProtection (144)
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorDescriptor.cs (2)
43var encryptionElement = new XElement("encryption", 51var outerElement = new XElement("descriptor",
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorDescriptorDeserializer.cs (4)
13/// A class that can deserialize an <see cref="XElement"/> that represents the serialized version 21public IAuthenticatedEncryptorDescriptor ImportFromXml(XElement element) 33var encryptionElement = element.Element("encryption")!; 39var validationElement = element.Element("validation")!;
AuthenticatedEncryption\ConfigurationModel\CngCbcAuthenticatedEncryptorDescriptor.cs (3)
46var encryptionElement = new XElement("encryption", 54var hashElement = new XElement("hash", 61var rootElement = new XElement("descriptor",
AuthenticatedEncryption\ConfigurationModel\CngCbcAuthenticatedEncryptorDescriptorDeserializer.cs (4)
13/// A class that can deserialize an <see cref="XElement"/> that represents the serialized version 22public IAuthenticatedEncryptorDescriptor ImportFromXml(XElement element) 35var encryptionElement = element.Element("encryption")!; 40var hashElement = element.Element("hash")!;
AuthenticatedEncryption\ConfigurationModel\CngGcmAuthenticatedEncryptorDescriptor.cs (2)
45var encryptionElement = new XElement("encryption", 53var rootElement = new XElement("descriptor",
AuthenticatedEncryption\ConfigurationModel\CngGcmAuthenticatedEncryptorDescriptorDeserializer.cs (3)
13/// A class that can deserialize an <see cref="XElement"/> that represents the serialized version 22public IAuthenticatedEncryptorDescriptor ImportFromXml(XElement element) 34var encryptionElement = element.Element("encryption")!;
AuthenticatedEncryption\ConfigurationModel\IAuthenticatedEncryptorDescriptor.cs (2)
18/// An <see cref="XmlSerializedDescriptorInfo"/> wrapping the <see cref="XElement"/> which represents the serialized 23/// element should be marked via the <see cref="XmlExtensions.MarkAsRequiresEncryption(XElement)" />
AuthenticatedEncryption\ConfigurationModel\IAuthenticatedEncryptorDescriptorDeserializer.cs (1)
19IAuthenticatedEncryptorDescriptor ImportFromXml(XElement element);
AuthenticatedEncryption\ConfigurationModel\ManagedAuthenticatedEncryptorDescriptor.cs (3)
45var encryptionElement = new XElement("encryption", 49var validationElement = new XElement("validation", 52var rootElement = new XElement("descriptor",
AuthenticatedEncryption\ConfigurationModel\ManagedAuthenticatedEncryptorDescriptorDeserializer.cs (4)
13/// A class that can deserialize an <see cref="XElement"/> that represents the serialized version 21public IAuthenticatedEncryptorDescriptor ImportFromXml(XElement element) 34var encryptionElement = element.Element("encryption")!; 38var validationElement = element.Element("validation")!;
AuthenticatedEncryption\ConfigurationModel\SecretExtensions.cs (3)
16/// <returns>The master key <see cref="XElement"/>.</returns> 17public static XElement ToMasterKeyElement(this ISecret secret) 37var masterKeyElement = new XElement("masterKey",
AuthenticatedEncryption\ConfigurationModel\XmlExtensions.cs (4)
11/// Data protection extensions for <see cref="XElement"/>. 15internal static bool IsMarkedAsRequiringEncryption(this XElement element) 21/// Marks the provided <see cref="XElement"/> as requiring encryption before being persisted 24public static void MarkAsRequiresEncryption(this XElement element)
AuthenticatedEncryption\ConfigurationModel\XmlSerializedDescriptorInfo.cs (5)
11/// Wraps an <see cref="XElement"/> that contains the XML-serialized representation of an 21/// <param name="deserializerType">The class whose <see cref="IAuthenticatedEncryptorDescriptorDeserializer.ImportFromXml(XElement)"/> 23public XmlSerializedDescriptorInfo(XElement serializedDescriptorElement, Type deserializerType) 40/// The class whose <see cref="IAuthenticatedEncryptorDescriptorDeserializer.ImportFromXml(XElement)"/> 48public XElement SerializedDescriptorElement { get; }
Internal\KeyManagementOptionsPostSetup.cs (2)
99EncryptedXmlInfo IXmlEncryptor.Encrypt(XElement plaintextElement) 112public override void StoreElement(XElement element, string friendlyName)
KeyManagement\IKeyEscrowSink.cs (1)
25void Store(Guid keyId, XElement element);
KeyManagement\Internal\IInternalXmlKeyManager.cs (1)
27IAuthenticatedEncryptorDescriptor DeserializeDescriptorFromKeyElement(XElement keyElement);
KeyManagement\Key.cs (2)
63XElement keyElement, 223private static Func<IAuthenticatedEncryptorDescriptor> GetLazyDescriptorDelegate(IInternalXmlKeyManager keyManager, XElement keyElement)
KeyManagement\KeyEscrowServiceProviderExtensions.cs (1)
33public void Store(Guid keyId, XElement element)
KeyManagement\XmlKeyManager.cs (12)
173foreach (var element in allElements) 266private Key? ProcessKeyElement(XElement keyElement) 322private object ProcessRevocationElement(XElement revocationElement) 365var revocationElement = new XElement(RevocationElementName, 398private void WriteKeyDeserializationErrorToLog(Exception error, XElement keyElement) 432var keyElement = new XElement(KeyElementName, 458var possiblyEncryptedKeyElement = KeyEncryptor?.EncryptIfNecessary(keyElement) ?? keyElement; 479IAuthenticatedEncryptorDescriptor IInternalXmlKeyManager.DeserializeDescriptorFromKeyElement(XElement keyElement) 484var descriptorElement = keyElement.Element(DescriptorElementName); 488var unencryptedInputToDeserializer = descriptorElement.Elements().Single().DecryptElement(_activator); 540var revocationElement = new XElement(RevocationElementName, 638public void Store(Guid keyId, XElement element)
LoggingExtensions.cs (3)
104public static partial void ExceptionWhileProcessingRevocationElement(this ILogger logger, XElement revocationElement, Exception exception); 113public static partial void ExceptionWhileProcessingKeyElement(this ILogger logger, XElement element, Exception exception); 116public static partial void AnExceptionOccurredWhileProcessingElementDebug(this ILogger logger, XElement element, Exception exception);
Repositories\EphemeralXmlRepository.cs (7)
19private readonly List<XElement> _storedElements = new List<XElement>(); 27public IReadOnlyCollection<XElement> GetAllElements() 36private IEnumerable<XElement> GetAllElementsCore() 39foreach (XElement element in _storedElements) 45public void StoreElement(XElement element, string friendlyName) 49var cloned = new XElement(element); // makes a deep copy so caller doesn't inadvertently modify it
Repositories\FileSystemXmlRepository.cs (6)
68public virtual IReadOnlyCollection<XElement> GetAllElements() 74private IEnumerable<XElement> GetAllElementsCore() 101private XElement ReadElementFromFile(string fullPath) 107return XElement.Load(fileStream); 112public virtual void StoreElement(XElement element, string friendlyName) 126private void StoreElementCore(XElement element, string filename)
Repositories\IXmlRepository.cs (2)
20IReadOnlyCollection<XElement> GetAllElements(); 34void StoreElement(XElement element, string friendlyName);
Repositories\RegistryXmlRepository.cs (7)
56public virtual IReadOnlyCollection<XElement> GetAllElements() 62private IEnumerable<XElement> GetAllElementsCore() 72var element = ReadElementFromRegKey(RegistryKey, valueName); 127private XElement? ReadElementFromRegKey(RegistryKey regKey, string valueName) 132return (!string.IsNullOrEmpty(data)) ? XElement.Parse(data) : null; 136public virtual void StoreElement(XElement element, string friendlyName) 150private void StoreElementCore(XElement element, string valueName)
XmlEncryption\CertificateXmlEncryptor.cs (6)
59/// Encrypts the specified <see cref="XElement"/> with an X.509 certificate. 67public EncryptedXmlInfo Encrypt(XElement plaintextElement) 75var encryptedElement = EncryptElement(plaintextElement); 83private XElement EncryptElement(XElement plaintextElement) 98return XElement.Load(xmlDocument.DocumentElement.FirstChild!.CreateNavigator()!.ReadSubtree());
XmlEncryption\DpapiNGXmlDecryptor.cs (2)
47public XElement Decrypt(XElement encryptedElement)
XmlEncryption\DpapiNGXmlEncryptor.cs (3)
49/// Encrypts the specified <see cref="XElement"/>. 57public EncryptedXmlInfo Encrypt(XElement plaintextElement) 85var element = new XElement("encryptedKey",
XmlEncryption\DpapiXmlDecryptor.cs (2)
44public XElement Decrypt(XElement encryptedElement)
XmlEncryption\DpapiXmlEncryptor.cs (3)
42/// Encrypts the specified <see cref="XElement"/>. 50public EncryptedXmlInfo Encrypt(XElement plaintextElement) 82var element = new XElement("encryptedKey",
XmlEncryption\EncryptedXmlDecryptor.cs (3)
57public XElement Decrypt(XElement encryptedElement) 78return XElement.Load(xmlDocument.DocumentElement!.FirstChild!.CreateNavigator()!.ReadSubtree());
XmlEncryption\EncryptedXmlInfo.cs (5)
11/// Wraps an <see cref="XElement"/> that contains a blob of encrypted XML 20/// <param name="decryptorType">The class whose <see cref="IXmlDecryptor.Decrypt(XElement)"/> 22public EncryptedXmlInfo(XElement encryptedElement, Type decryptorType) 39/// The class whose <see cref="IXmlDecryptor.Decrypt(XElement)"/> method can be used to 47public XElement EncryptedElement { get; }
XmlEncryption\IXmlDecryptor.cs (3)
19/// Implementations of this method must not mutate the <see cref="XElement"/> 22XElement Decrypt(XElement encryptedElement);
XmlEncryption\IXmlEncryptor.cs (3)
14/// Encrypts the specified <see cref="XElement"/>. 23/// Implementations of this method must not mutate the <see cref="XElement"/> 26EncryptedXmlInfo Encrypt(XElement plaintextElement);
XmlEncryption\NullXmlDecryptor.cs (2)
21public XElement Decrypt(XElement encryptedElement)
XmlEncryption\NullXmlEncryptor.cs (3)
36/// Encrypts the specified <see cref="XElement"/> with a null encryptor, i.e., 45public EncryptedXmlInfo Encrypt(XElement plaintextElement) 56var newElement = new XElement("unencryptedKey",
XmlEncryption\XmlEncryptionExtensions.cs (22)
19public static XElement DecryptElement(this XElement element, IActivator activator) 35var placeholderReplacements = new Dictionary<XElement, XElement>(); 39var elementWhichRequiresDecryption = doc.Descendants(XmlConstants.EncryptedSecretElementName).FirstOrDefault(); 49var clonedElementWhichRequiresDecryption = new XElement(elementWhichRequiresDecryption); 52var decryptedElement = decryptorInstance.Decrypt(clonedElementWhichRequiresDecryption.Elements().Single()); 56var newPlaceholder = new XElement("placeholder"); 101public static XElement? EncryptIfNecessary(this IXmlEncryptor encryptor, XElement element) 117var placeholderReplacements = new Dictionary<XElement, EncryptedXmlInfo>(); 121var elementWhichRequiresEncryption = doc.Descendants().FirstOrDefault(DoesSingleElementRequireEncryption); 130var clonedElementWhichRequiresEncryption = new XElement(elementWhichRequiresEncryption); 137var newPlaceholder = new XElement("placeholder"); 158/// Converts an <see cref="XElement"/> to a <see cref="Secret"/> so that it can be kept in memory 161public static Secret ToSecret(this XElement element) 182/// Converts a <see cref="Secret"/> back into an <see cref="XElement"/>. 184public static XElement ToXElement(this Secret secret) 193return XElement.Load(memoryStream); 202private static bool DoesElementOrDescendentRequireDecryption(XElement element) 207private static bool DoesElementOrDescendentRequireEncryption(XElement element) 212private static bool DoesSingleElementRequireEncryption(XElement element)
XmlExtensions.cs (3)
19public static XElement WithoutChildNodes(this XElement element) 21var newElement = new XElement(element.Name);
Microsoft.AspNetCore.DataProtection.EntityFrameworkCore (4)
EntityFrameworkCoreXmlRepository.cs (4)
41public virtual IReadOnlyCollection<XElement> GetAllElements() 46IEnumerable<XElement> GetAllElementsCore() 58yield return XElement.Parse(key.Xml); 66public void StoreElement(XElement element, string friendlyName)
Microsoft.AspNetCore.DataProtection.StackExchangeRedis (4)
RedisXmlRepository.cs (4)
33public IReadOnlyCollection<XElement> GetAllElements() 38private IEnumerable<XElement> GetAllElementsCore() 48yield return XElement.Parse((string)value!); 53public void StoreElement(XElement element, string friendlyName)
Microsoft.AspNetCore.DataProtection.Tests (145)
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorDescriptorDeserializerTests.cs (1)
33var deserializedDescriptor = new AuthenticatedEncryptorDescriptorDeserializer().ImportFromXml(XElement.Parse(xml));
AuthenticatedEncryption\ConfigurationModel\CngCbcAuthenticatedEncryptorDescriptorDeserializerTests.cs (1)
40var deserializedDescriptor = new CngCbcAuthenticatedEncryptorDescriptorDeserializer().ImportFromXml(XElement.Parse(xml));
AuthenticatedEncryption\ConfigurationModel\CngGcmAuthenticatedEncryptorDescriptorDeserializerTests.cs (1)
37var deserializedDescriptor = new CngGcmAuthenticatedEncryptorDescriptorDeserializer().ImportFromXml(XElement.Parse(xml));
AuthenticatedEncryption\ConfigurationModel\ManagedAuthenticatedEncryptorDescriptorDeserializerTests.cs (4)
41var deserializedDescriptor = new ManagedAuthenticatedEncryptorDescriptorDeserializer().ImportFromXml(XElement.Parse(xml)); 75var deserializedDescriptor = new ManagedAuthenticatedEncryptorDescriptorDeserializer().ImportFromXml(XElement.Parse(xml)); 102var deserializedDescriptor = new ManagedAuthenticatedEncryptorDescriptorDeserializer().ImportFromXml(XElement.Parse(xml)); 125var ex = Assert.Throws<InvalidOperationException>(() => new ManagedAuthenticatedEncryptorDescriptorDeserializer().ImportFromXml(XElement.Parse(xml)));
Internal\KeyManagementOptionsPostSetupTest.cs (1)
17private static readonly XElement xElement = new("element");
Internal\KeyManagementOptionsSetupTest.cs (2)
136public void Store(Guid keyId, XElement element) 144public void Store(Guid keyId, XElement element)
KeyManagement\DeferredKeyTests.cs (7)
25mockInternalKeyManager.Setup(o => o.DeserializeDescriptorFromKeyElement(It.IsAny<XElement>())) 26.Returns<XElement>(element => 34var key = new Key(keyId, creationDate, activationDate, expirationDate, mockInternalKeyManager.Object, XElement.Parse(@"<node />"), new[] { encryptorFactory }); 50var key = new Key(Guid.Empty, now, now, now, new Mock<IInternalXmlKeyManager>().Object, XElement.Parse(@"<node />"), new[] { encryptorFactory }); 64mockKeyManager.Setup(o => o.DeserializeDescriptorFromKeyElement(It.IsAny<XElement>())) 65.Returns<XElement>(element => 73var key = new Key(Guid.Empty, now, now, now, mockKeyManager.Object, XElement.Parse(@"<node />"), new[] { encryptorFactory });
KeyManagement\KeyEscrowServiceProviderExtensionsTests.cs (8)
36mockKeyEscrowSink.Setup(o => o.Store(It.IsAny<Guid>(), It.IsAny<XElement>())) 37.Callback<Guid, XElement>((keyId, element) => 48sink.Store(new Guid("39974d8e-3e53-4d78-b7e9-4ff64a2a5d7b"), XElement.Parse("<theElement />")); 61mockKeyEscrowSink1.Setup(o => o.Store(It.IsAny<Guid>(), It.IsAny<XElement>())) 62.Callback<Guid, XElement>((keyId, element) => 68mockKeyEscrowSink2.Setup(o => o.Store(It.IsAny<Guid>(), It.IsAny<XElement>())) 69.Callback<Guid, XElement>((keyId, element) => 81sink.Store(new Guid("39974d8e-3e53-4d78-b7e9-4ff64a2a5d7b"), XElement.Parse("<theElement />"));
KeyManagement\XmlKeyManagerTests.cs (29)
23private static readonly XElement serializedDescriptor = XElement.Parse(@" 84XElement elementStoredInRepository = null; 95.Setup(o => o.StoreElement(It.IsAny<XElement>(), It.IsAny<string>())) 96.Callback<XElement, string>((el, friendlyName) => 171XElement elementStoredInEscrow = null; 173XElement elementStoredInRepository = null; 184.Setup(o => o.StoreElement(It.IsAny<XElement>(), It.IsAny<string>())) 185.Callback<XElement, string>((el, friendlyName) => 192.Setup(o => o.Store(It.IsAny<Guid>(), It.IsAny<XElement>())) 193.Callback<Guid, XElement>((innerKeyId, el) => 599mockXmlRepository.Setup(o => o.GetAllElements()).Returns(XElement.Parse(xml).Elements().ToArray()); 616XElement elementStoredInRepository = null; 620.Setup(o => o.StoreElement(It.IsAny<XElement>(), It.IsAny<string>())) 621.Callback<XElement, string>((el, friendlyName) => 666XElement elementStoredInRepository = null; 670.Setup(o => o.StoreElement(It.IsAny<XElement>(), It.IsAny<string>())) 671.Callback<XElement, string>((el, friendlyName) => 768.Setup(o => o.ImportFromXml(It.IsAny<XElement>())) 775.Setup(o => o.Decrypt(It.IsAny<XElement>())) 776.Returns<XElement>(element => 785.Setup(o => o.Encrypt(It.IsAny<XElement>())) 787.Returns<XElement>(element => new EncryptedXmlInfo(element, typeof(IXmlDecryptor))); 850.Setup(o => o.ImportFromXml(It.IsAny<XElement>())) 857.Setup(o => o.Decrypt(It.IsAny<XElement>())) 858.Returns<XElement>(element => 875var keyElement = XElement.Parse(@" 933public IAuthenticatedEncryptorDescriptor ImportFromXml(XElement element)
MockExtensions.cs (5)
26.Setup(o => o.ImportFromXml(It.IsAny<XElement>())) 27.Returns<XElement>(el => 49.Setup(o => o.Decrypt(It.IsAny<XElement>())) 50.Returns<XElement>(el => 54return XElement.Parse(outputXml);
RegistryPolicyResolverTests.cs (2)
308public void Store(Guid keyId, XElement element) 316public void Store(Guid keyId, XElement element)
Repositories\EphemeralXmlRepositoryTests.cs (6)
25var element1 = XElement.Parse(@"<element1 />"); 26var element2 = XElement.Parse(@"<element1 />"); 27var element3 = XElement.Parse(@"<element1 />");
Repositories\FileSystemXmlRepositoryTests.cs (10)
68var element = XElement.Parse("<element1 />"); 82var parsedElement = XElement.Parse(File.ReadAllText(fileInfo.FullName)); 98var element = XElement.Parse("<element1 />"); 116var parsedElement = XElement.Parse(File.ReadAllText(fileInfo.FullName)); 165var element = XElement.Parse("<element1 />");
Repositories\RegistryXmlRepositoryTests.cs (8)
56var element = XElement.Parse("<element1 />"); 70var parsedElement = XElement.Parse(regKey.GetValue(valueName) as string); 87var element = XElement.Parse("<element1 />"); 102var parsedElement = XElement.Parse(regKey.GetValue(valueName) as string);
ServiceCollectionTests.cs (1)
99var xElement = new XElement("element");
XmlAssert.cs (13)
17/// Asserts that a <see cref="string"/> and an <see cref="XElement"/> are semantically equivalent. 19public static void Equal(string expected, XElement actual) 23Equal(XElement.Parse(expected), actual); 27/// Asserts that two <see cref="XElement"/> instances are semantically equivalent. 29public static void Equal(XElement expected, XElement actual) 48private static bool AreEqual(XElement expected, XElement actual) 68else if (expected is XElement && actual is XElement) 70return AreEqual((XElement)expected, (XElement)actual); 119if (node is XText /* includes XCData */ || node is XElement)
XmlEncryption\CertificateXmlEncryptionTests.cs (3)
45var originalXml = XElement.Parse(@"<mySecret value='265ee4ea-ade2-43b1-b706-09b259e58b6b' />"); 55var roundTrippedElement = decryptor.Decrypt(encryptedXmlInfo.EncryptedElement);
XmlEncryption\DpapiNGXmlEncryptionTests.cs (3)
18var originalXml = XElement.Parse(@"<mySecret value='265ee4ea-ade2-43b1-b706-09b259e58b6b' />"); 28var roundTrippedElement = decryptor.Decrypt(encryptedXmlInfo.EncryptedElement);
XmlEncryption\DpapiXmlEncryptionTests.cs (3)
20var originalXml = XElement.Parse(@"<mySecret value='265ee4ea-ade2-43b1-b706-09b259e58b6b' />"); 30var roundTrippedElement = decryptor.Decrypt(encryptedXmlInfo.EncryptedElement);
XmlEncryption\EncryptedXmlDecryptorTests.cs (5)
20var data = new XElement("SampleData", "Lorem ipsum"); 38var data = new XElement("SampleData", "Lorem ipsum"); 56var data = new XElement("SampleData", "Lorem ipsum"); 78var data = new XElement("SampleData", "Lorem ipsum"); 82var decrypted = decryptor.Decrypt(encryptedXml.EncryptedElement);
XmlEncryption\NullXmlEncryptionTests.cs (3)
17var retVal = decryptor.Decrypt(XElement.Parse("<unencryptedKey><theElement /></unencryptedKey>")); 30var retVal = encryptor.Encrypt(XElement.Parse("<theElement />"));
XmlEncryption\XmlEncryptionExtensionsTests.cs (29)
18var original = XElement.Parse(@"<element />"); 32var original = XElement.Parse(@" 58var original = XElement.Parse(@$" 88var original = XElement.Parse(@$" 120var original = XElement.Parse(@$" 150var original = XElement.Parse(@" 178.Setup(o => o.Decrypt(It.IsAny<XElement>())) 179.Returns<XElement>(el => new XElement(el.Name.LocalName + "_decrypted", new XElement(XmlConstants.EncryptedSecretElementName, "nested"))); 200var original = XElement.Parse(@"<element />"); 215var original = XElement.Parse(@"<rootNode x:requiresEncryption='true' xmlns:x='http://schemas.asp.net/2015/03/dataProtection' />"); 217mockXmlEncryptor.Setup(o => o.Encrypt(It.IsAny<XElement>())).Returns(new EncryptedXmlInfo(new XElement("theElement"), typeof(MyXmlDecryptor))); 233var original = XElement.Parse(@" 264.Setup(o => o.Encrypt(It.IsAny<XElement>())) 265.Returns<XElement>(element => new EncryptedXmlInfo(new XElement(element.Name.LocalName + "_encrypted"), typeof(MyXmlDecryptor))); 278var original = XElement.Parse(@" 313.Setup(o => o.Encrypt(It.IsAny<XElement>())) 314.Returns<XElement>(element => new EncryptedXmlInfo(new XElement(element), typeof(MyXmlDecryptor))); 325public XElement Decrypt(XElement encryptedElement)
Microsoft.AspNetCore.Http.Connections.Tests (7)
src\SignalR\common\Shared\EphemeralDataProtectionProvider.cs (7)
11 private readonly List<XElement> _storedElements = new List<XElement>(); 17 public IReadOnlyCollection<XElement> GetAllElements() 26 private IEnumerable<XElement> GetAllElementsCore() 29 foreach (XElement element in _storedElements) 35 public void StoreElement(XElement element, string friendlyName) 37 var cloned = new XElement(element); // makes a deep copy so caller doesn't inadvertently modify it
Microsoft.AspNetCore.Identity.InMemory.Test (4)
FunctionalTest.cs (4)
283var claim = transaction.ResponseElement.Elements("claim").SingleOrDefault(elt => elt.Attribute("type").Value == claimType); 409var xml = new XElement("xml"); 458transaction.ResponseElement = XElement.Parse(transaction.ResponseText); 472public XElement ResponseElement { get; set; }
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (2)
XmlAssert.cs (2)
64XElement element = node as XElement;
Microsoft.AspNetCore.Mvc.FunctionalTests (10)
AsyncEnumerableTestBase.cs (2)
83string GetName(XElement element) 85var name = element.Element(XName.Get("Name", @namespace));
src\Mvc\Mvc.Formatters.Xml\test\XmlAssert.cs (2)
64XElement element = node as XElement;
XmlDataContractSerializerFormattersWrappingTest.cs (3)
228var root = XDocument.Parse(content).Root; 270var root = XDocument.Parse(content).Root; 274var mvcErrors = root.Element(root.Name.Namespace.GetName("MVC-Errors"));
XmlSerializerFormattersWrappingTest.cs (3)
210var root = XDocument.Parse(content).Root; 252var root = XDocument.Parse(content).Root; 255var mvcErrors = root.Element(root.Name.Namespace.GetName("MVC-Errors"));
Microsoft.AspNetCore.Rewrite (20)
IISUrlRewrite\InvalidUrlRewriteFormatException.cs (3)
14public InvalidUrlRewriteFormatException(XElement element, string message) 19public InvalidUrlRewriteFormatException(XElement element, string message, Exception innerException) 27private static string FormatMessage(XElement element, string message)
IISUrlRewrite\RewriteMapParser.cs (4)
11public static IISRewriteMapCollection? Parse(XElement xmlRoot) 15var mapsElement = xmlRoot.Descendants(RewriteTags.RewriteMaps).SingleOrDefault(); 22foreach (var mapElement in mapsElement.Elements(RewriteTags.RewriteMap)) 25foreach (var addElement in mapElement.Elements(RewriteTags.Add))
IISUrlRewrite\UrlRewriteFileParser.cs (13)
24var xmlRoot = xmlDoc.Descendants(RewriteTags.Rewrite).FirstOrDefault(); 39private void ParseRules(XElement? rules, IList<IISUrlRewriteRule> result, bool global) 46foreach (var rule in rules.Elements(RewriteTags.Rule)) 58private void ParseRuleAttributes(XElement rule, UrlRewriteRuleBuilder builder) 74var match = rule.Element(RewriteTags.Match); 80var action = rule.Element(RewriteTags.Action); 91private static void ParseMatch(XElement match, UrlRewriteRuleBuilder builder, PatternSyntax patternSyntax) 104private void ParseConditions(XElement? conditions, UrlRewriteRuleBuilder builder, PatternSyntax patternSyntax) 121foreach (var cond in adds) 127private void ParseCondition(XElement conditionElement, UrlRewriteRuleBuilder builder, PatternSyntax patternSyntax) 188private void ParseUrlAction(XElement urlAction, UrlRewriteRuleBuilder builder, bool stopProcessing) 253private static bool ParseBool(XElement element, string rewriteTag, bool defaultValue) 268private static TEnum ParseEnum<TEnum>(XElement element, string rewriteTag, TEnum defaultValue)
Microsoft.AspNetCore.Rewrite.Tests (1)
IISUrlRewrite\RewriteMapParserTests.cs (1)
28var xmlRoot = xmlDoc.Descendants(RewriteTags.Rewrite).FirstOrDefault();
Microsoft.AspNetCore.Server.IntegrationTesting (3)
Deployers\RemoteWindowsDeployer\RemoteWindowsDeployer.cs (3)
155var aspNetCoreSection = webConfig.Descendants("aspNetCore") 166var environmentVariablesSection = aspNetCoreSection.Elements("environmentVariables").FirstOrDefault(); 175var environmentVariable = new XElement("environmentVariable");
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (56)
IISDeployer.cs (5)
129protected override IEnumerable<Action<XElement, string>> GetWebConfigActions() 137var aspNetCore = element 345private void ConfigureAppHostConfig(XElement config, string contentRoot, int port) 355var pool = config 362var environmentVariables = pool
IISDeployerBase.cs (10)
23public void ModifyApplicationHostConfig(Action<XElement> action) 54protected virtual IEnumerable<Action<XElement, string>> GetWebConfigActions() 72protected virtual IEnumerable<Action<XElement, string>> GetServerConfigActions() 80public void RunServerConfigActions(XElement config, string contentRoot) 109private void AddWebConfigEnvironmentVariables(XElement element, string contentRoot) 111var environmentVariables = element 124private void AddHandlerSettings(XElement element, string contentRoot) 126var handlerSettings = element 139protected void ConfigureModuleAndBinding(XElement config, string contentRoot, int port) 141var siteElement = config
IISDeploymentParameterExtensions.cs (18)
16public static void AddServerConfigAction(this IISDeploymentParameters parameters, Action<XElement> action) 21public static void AddServerConfigAction(this IISDeploymentParameters parameters, Action<XElement, string> action) 64var windowsAuthentication = element 71var providers = windowsAuthentication.GetOrAdd("providers"); 113var element = config 148var webServerElement = element 151var addElement = webServerElement 161var traceAreasElement = addElement 163var innerAddElement = traceAreasElement.GetOrAdd("add", "provider", "WWW Server"); 173var webServerElement = element 176var traceProviderDefinitionsElement = webServerElement 180var innerAddElement = traceProviderDefinitionsElement.GetOrAdd("add", "name", "WWW Server"); 185var areasElement = innerAddElement.GetOrAdd("areas"); 186var iae = areasElement.GetOrAdd("add", "name", "ANCM"); 195var traceFailedRequestsElement = element 211var aspNetCoreElement = config.Descendants("aspNetCore").Single(); 221var aspNetCoreElement = config.Descendants("aspNetCore").Single(); 236var webServerElement = element
IISDeploymentParameters.cs (4)
40public IList<Action<XElement, string>> WebConfigActionList { get; } = new List<Action<XElement, string>>(); 42public IList<Action<XElement, string>> ServerConfigActionList { get; } = new List<Action<XElement, string>>();
IISExpressDeployer.cs (5)
314private void AddAspNetCoreElement(XElement config) 316var aspNetCore = config 324var handlers = config 329var aspNetCoreHandler = handlers 341protected override IEnumerable<Action<XElement, string>> GetWebConfigActions()
WebConfigHelpers.cs (2)
10public static Action<XElement, string> AddOrModifyAspNetCoreSection(string key, string value) 22public static Action<XElement, string> AddOrModifyHandlerSection(string key, string value)
XElementExtensions.cs (12)
10public static XElement RequiredElement(this XElement element, string name) 12var existing = element.Element(name); 21public static XElement GetOrAdd(this XElement element, string name) 23var existing = element.Element(name); 33public static XElement GetOrAdd(this XElement element, string name, string attribute, string attributeValue) 35var existing = element.Elements(name).FirstOrDefault(e => e.Attribute(attribute)?.Value == attributeValue); 45public static XElement AddAndGetInnerElement(this XElement element, string name, string attribute, string attributeValue) 47var innerElement = new XElement(name, new XAttribute(attribute, attributeValue));
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (7)
src\SignalR\common\Shared\EphemeralDataProtectionProvider.cs (7)
11 private readonly List<XElement> _storedElements = new List<XElement>(); 17 public IReadOnlyCollection<XElement> GetAllElements() 26 private IEnumerable<XElement> GetAllElementsCore() 29 foreach (XElement element in _storedElements) 35 public void StoreElement(XElement element, string friendlyName) 37 var cloned = new XElement(element); // makes a deep copy so caller doesn't inadvertently modify it
Microsoft.AspNetCore.SignalR.Tests (7)
src\SignalR\common\Shared\EphemeralDataProtectionProvider.cs (7)
11 private readonly List<XElement> _storedElements = new List<XElement>(); 17 public IReadOnlyCollection<XElement> GetAllElements() 26 private IEnumerable<XElement> GetAllElementsCore() 29 foreach (XElement element in _storedElements) 35 public void StoreElement(XElement element, string friendlyName) 37 var cloned = new XElement(element); // makes a deep copy so caller doesn't inadvertently modify it
Microsoft.Build.BuildCheck.UnitTests (1)
TestAssemblyInfo.cs (1)
115var cliVersionElement = doc.Root.Elements(ns + "PropertyGroup").Elements(ns + "DotNetCliVersion").FirstOrDefault();
Microsoft.Build.CommandLine.UnitTests (1)
TestAssemblyInfo.cs (1)
115var cliVersionElement = doc.Root.Elements(ns + "PropertyGroup").Elements(ns + "DotNetCliVersion").FirstOrDefault();
Microsoft.Build.Engine.OM.UnitTests (1)
TestAssemblyInfo.cs (1)
115var cliVersionElement = doc.Root.Elements(ns + "PropertyGroup").Elements(ns + "DotNetCliVersion").FirstOrDefault();
Microsoft.Build.Engine.UnitTests (1)
TestAssemblyInfo.cs (1)
115var cliVersionElement = doc.Root.Elements(ns + "PropertyGroup").Elements(ns + "DotNetCliVersion").FirstOrDefault();
Microsoft.Build.Framework.UnitTests (1)
TestAssemblyInfo.cs (1)
115var cliVersionElement = doc.Root.Elements(ns + "PropertyGroup").Elements(ns + "DotNetCliVersion").FirstOrDefault();
Microsoft.Build.Tasks.Core (23)
AssemblyDependency\GenerateBindingRedirects.cs (11)
73XElement runtimeNode = doc.Root 75.OfType<XElement>() 193private void UpdateExistingBindingRedirects(XElement runtimeNode, IDictionary<AssemblyName, string> redirects) 198.OfType<XElement>() 201foreach (var assemblyBinding in assemblyBindingNodes) 205.OfType<XElement>() 208foreach (var dependentAssembly in dependentAssemblies) 210var assemblyIdentity = dependentAssembly 212.OfType<XElement>() 223var bindingRedirect = dependentAssembly 225.OfType<XElement>()
AssemblyDependency\ResolveAssemblyReference.cs (1)
1220var node = new XElement(
CombineTargetFrameworkInfoProperties.cs (1)
48XElement root = UseAttributeForTargetFrameworkInfoPropertyNames ?
CombineXmlElements.cs (2)
36XElement root = new XElement(RootElementName); 40root.Add(XElement.Parse(item.ItemSpec));
GenerateResource.cs (1)
3061foreach (XElement dataElem in doc.Element("root").Elements("data"))
ResourceHandling\MSBuildResXReader.cs (4)
32foreach (XElement elem in doc.Element("root").Elements()) 56private static void ParseAssemblyAlias(Dictionary<string, string> aliases, XElement elem) 110XElement elem, 118XElement valueElement = elem.Element("value");
RoslynCodeTaskFactory\RoslynCodeTaskFactory.cs (3)
322XElement codeElement = null; 332XElement child = (XElement)node;
Microsoft.Build.Tasks.UnitTests (3)
GenerateBindingRedirects_Tests.cs (2)
142XElement targetAppConfig = XElement.Parse(redirectResults.TargetAppConfigContent);
TestAssemblyInfo.cs (1)
115var cliVersionElement = doc.Root.Elements(ns + "PropertyGroup").Elements(ns + "DotNetCliVersion").FirstOrDefault();
Microsoft.Build.Utilities.UnitTests (1)
TestAssemblyInfo.cs (1)
115var cliVersionElement = doc.Root.Elements(ns + "PropertyGroup").Elements(ns + "DotNetCliVersion").FirstOrDefault();
Microsoft.Cci.Extensions (5)
Dgml\DgmlExtensions.cs (5)
31var xRoot = new XElement(XName.Get("DirectedGraph", dgmlNsp)); 34var xNodes = new XElement(XName.Get("Nodes", dgmlNsp)); 41var xNode = new XElement(XName.Get("Node", dgmlNsp), 47var xLinks = new XElement(XName.Get("Links", dgmlNsp)); 54var xLink = new XElement(XName.Get("Link", dgmlNsp),
Microsoft.DotNet.Arcade.Sdk (14)
src\ExtractNgenMethodList.cs (2)
55var parentElement = document.Root.Element("MethodProfilingData"); 58foreach (var child in parentElement.Elements("Item"))
src\GenerateResxSource.cs (1)
106foreach (var node in XDocument.Load(ResourceFile).Descendants("data"))
src\SourceBuild\AddSourceMappingToNugetConfig.cs (4)
28XElement pkgSrcMappingElement = document.Root.Descendants().FirstOrDefault(e => e.Name == "packageSourceMapping"); 45internal void AddPkgSourceMapping(XElement pkgSrcMappingElement) 55XElement pkgSrcMappingClearElement = pkgSrcMappingElement.Descendants().FirstOrDefault(e => e.Name == "clear"); 62var pkgSrc = new XElement("packageSource", new XAttribute("key", SourceName));
src\SourceBuild\AddSourceToNuGetConfig.cs (4)
40XElement packageSourcesElement = document.Root 43var sourceElementToAdd = new XElement( 48XElement existingSourceElement = packageSourcesElement 52XElement lastClearElement = packageSourcesElement
src\SourceBuild\ReadSourceBuildIntermediateNupkgDependencies.cs (3)
45XElement root = XElement.Load(VersionDetailsXmlFile, LoadOptions.PreserveWhitespace); 57XElement sourceBuildElement = d.Element(CreateQualifiedName("SourceBuild"));
Microsoft.DotNet.Arcade.Sdk.Tests (3)
SourceMappingToNugetConfigTest.cs (3)
49XElement packageSourceMapping = document.Root; 54XElement generatedMapping = packageSourceMapping 78XElement firstElement = packageSourceMapping
Microsoft.DotNet.Build.Tasks.Feed (1)
src\BuildModelFactory.cs (1)
242return BuildModel.Parse(XElement.Load(assetManifestPath));
Microsoft.DotNet.Build.Tasks.Installers (10)
src\CreateWixCommandPackageDropBase.cs (4)
245IEnumerable<XElement> iels = doc.XPathSelectElements(xpath, nsmgr); 249foreach (XElement row in iels) 251IEnumerable<XElement> fields = row.XPathSelectElements("wix:field", nsmgr); 265foreach (XElement field in fields)
src\GenerateMacOSDistributionFile.cs (5)
41var titleElement = new XElement("title", $"{ProductBrandName} ({TargetArchitecture})"); 62var scriptElement = new XElement("script", new XCData(archScriptContent)); 94var optionsElement = document.Root.Element("options"); 134public static XElement WithAttribute(this XElement element, XName attribute, object value)
src\StabilizeWixFileId.cs (1)
67XElement[] matchingFileElements = content.Element(GetQualifiedName("Wix"))
Microsoft.DotNet.Build.Tasks.Packaging (2)
GenerateNuSpec.cs (1)
164var licenseUrlElement = nuspec.Descendants(NuSpecXmlNamespace + "licenseUrl").Single();
PackageIndex.cs (1)
217foreach (var file in frameworkList.Element("FileList").Elements("File"))
Microsoft.DotNet.Build.Tasks.VisualStudio (1)
Vsix\FinalizeInsertionVsixFile.cs (1)
79var installationElement = document.Element(XName.Get("PackageManifest", VsixNamespace))?.Element(XName.Get("Installation", VsixNamespace));
Microsoft.DotNet.Build.Tasks.Workloads (6)
Msi\MsiPayloadPackageProject.wix.cs (1)
58var itemGroup = proj.Root.Element("ItemGroup");
Msi\WorkloadPackGroupMsi.wix.cs (5)
85var dotnetHomeElement = directoriesDoc.Root.Descendants().Where(d => (string)d.Attribute("Id") == "DOTNETHOME").Single(); 94var componentGroupRefElement = productDoc.Root.Descendants(ns + "ComponentGroupRef").Single(); 102var registryKeyElement = registryDoc.Root.Descendants(ns + "RegistryKey").Single(); 181public XElement ToXml() 184var xml = new XElement(ns + "Directory");
Microsoft.DotNet.NuGetRepack.Tasks (10)
src\NuGetVersionUpdater.cs (8)
149var metadata = nuspecXml.Element(XName.Get("package", nuspecXmlns))?.Element(XName.Get("metadata", nuspecXmlns)); 161var versionElement = metadata.Element(XName.Get("version", nuspecXmlns)); 264private static bool IsDotnetTool(string nuspecXmlns, XElement metadata) 266var packageTypesElement = metadata.Element(XName.Get("packageTypes", nuspecXmlns)); 269foreach (var packageType in packageTypesElement.Elements(XName.Get("packageType", nuspecXmlns)) ?? Array.Empty<XElement>()) 293Descendants(XName.Get("dependency", package.NuspecXmlns)) ?? Array.Empty<XElement>(); 295foreach (var dependency in dependencies)
src\ReplacePackageParts.cs (2)
155var metadata = nuspecXml.Element(XName.Get("package", nuspecXmlns))?.Element(XName.Get("metadata", nuspecXmlns)); 169var versionElement = metadata.Element(XName.Get("version", nuspecXmlns));
Microsoft.DotNet.NuGetRepack.Tests (2)
TestHelpers\FakeBuildEngine.cs (2)
26public readonly List<ImmutableArray<XElement>> FilesToSign = new List<ImmutableArray<XElement>>();
Microsoft.DotNet.PackageTesting (4)
VerifyClosure.cs (4)
347var nodesElement = new XElement(s_dgmlns + "Nodes"); 348var linksElement = new XElement(s_dgmlns + "Links"); 377var categoriesElement = new XElement(s_dgmlns + "Categories"); 396private static bool TryAddNode(ICollection<string> existing, XElement parent, string id, bool isNative = false)
Microsoft.DotNet.SharedFramework.Sdk (6)
src\CreateFrameworkListFile.cs (2)
67var frameworkManifest = new XElement("FileList", rootAttributes); 158var element = new XElement(
src\Microsoft.DotNet.PackageTesting\VerifyClosure.cs (4)
347var nodesElement = new XElement(s_dgmlns + "Nodes"); 348var linksElement = new XElement(s_dgmlns + "Links"); 377var categoriesElement = new XElement(s_dgmlns + "Categories"); 396private static bool TryAddNode(ICollection<string> existing, XElement parent, string id, bool isNative = false)
Microsoft.DotNet.SignTool.Tests (3)
FakeBuildEngine.cs (3)
28public readonly List<ImmutableArray<XElement>> FilesToSign = new List<ImmutableArray<XElement>>(); 61foreach (var file in filesToSign)
Microsoft.DotNet.SourceBuild.Tasks (20)
src\UsageReport\AnnotatedUsage.cs (1)
19public XElement ToXml() => new XElement(
src\UsageReport\Usage.cs (2)
30public XElement ToXml() => new XElement( 38public static Usage Parse(XElement xml) => new Usage
src\UsageReport\UsageData.cs (2)
18public XElement ToXml() => new XElement( 43public static UsageData Parse(XElement xml) => new UsageData
src\UsageReport\UsagePattern.cs (2)
15public XElement ToXml() => new XElement( 20public static UsagePattern Parse(XElement xml) => new UsagePattern
src\UsageReport\UsageValidationData.cs (1)
13public XElement Report { get; set; }
src\UsageReport\ValidateUsageAgainstBaseline.cs (3)
53var used = UsageData.Parse(XElement.Parse(File.ReadAllText(DataFile))); 59var baseline = UsageData.Parse(XElement.Parse(baselineText)); 84var report = new XElement("BaselineComparison");
src\UsageReport\WriteUsageReports.cs (7)
63UsageData data = UsageData.Parse(XElement.Parse(File.ReadAllText(DataFile))); 81var xml = XElement.Parse(File.ReadAllText(ProdConBuildManifestFile)); 82foreach (var x in xml.Descendants("Package")) 107var report = new XElement("AnnotatedUsages"); 178Xml = XElement.Parse(content) 244public static PackageVersionPropsElement[] Parse(XElement xml)
src\UsageReport\XmlParsingHelpers.cs (2)
15public static XElement ToXElement(this PackageIdentity ident) => new XElement( 26public static PackageIdentity ParsePackageIdentity(XElement xml) => new PackageIdentity(
Microsoft.DotNet.SourceBuild.Tasks.Tests (1)
ValidateUsageAgainstBaselineTests.cs (1)
42XElement
Microsoft.DotNet.VersionTools (36)
Automation\NupkgInfoFactory.cs (3)
59XElement metadataElement = GetSingleElement(doc.Root, "metadata"); 63private static XElement GetSingleElement(XElement el, string name)
BuildManifest\BuildManifestClient.cs (5)
36XElement contents = await FetchModelXmlAsync(project, @ref, basePath); 119XElement remoteModelXml = await FetchModelXmlAsync( 145XElement modifiedModelXml = modifiedModel.ToXml(); 201private async Task<XElement> FetchModelXmlAsync( 216return XElement.Parse(contents);
BuildManifest\Model\ArtifactSet.cs (2)
23public IEnumerable<XElement> ToXml() => Enumerable.Concat( 32public static ArtifactSet Parse(XElement xml) => new ArtifactSet
BuildManifest\Model\BlobArtifactModel.cs (2)
97public XElement ToXml() => new XElement( 103public static BlobArtifactModel Parse(XElement xml) => new BlobArtifactModel
BuildManifest\Model\BuildIdentity.cs (2)
163public XElement ToXmlBuildElement() => new XElement("Build", ToXmlAttributes()); 165public static BuildIdentity Parse(XElement xml) => new BuildIdentity
BuildManifest\Model\BuildModel.cs (2)
28public XElement ToXml() => new XElement( 34public static BuildModel Parse(XElement xml) => new BuildModel(BuildIdentity.Parse(xml))
BuildManifest\Model\EndpointModel.cs (2)
49public XElement ToXml() => new XElement( 54public static EndpointModel Parse(XElement xml) => new EndpointModel
BuildManifest\Model\OrchestratedBuildModel.cs (2)
42public XElement ToXml() => new XElement( 48public static OrchestratedBuildModel Parse(XElement xml) => new OrchestratedBuildModel(BuildIdentity.Parse(xml))
BuildManifest\Model\PackageArtifactModel.cs (2)
115public XElement ToXml() => new XElement( 121public static PackageArtifactModel Parse(XElement xml) => new PackageArtifactModel
BuildManifest\Model\SigningInformationModel.cs (12)
35public XElement ToXml() => IsEmpty() ? null : new XElement( 65public static SigningInformationModel Parse(XElement xml) => xml == null ? null : new SigningInformationModel 101public XElement ToXml() => new XElement( 107public static FileExtensionSignInfoModel Parse(XElement xml) => new FileExtensionSignInfoModel 150public XElement ToXml() => new XElement( 156public static FileSignInfoModel Parse(XElement xml) => new FileSignInfoModel 186public XElement ToXml() => new XElement( 192public static CertificatesSignInfoModel Parse(XElement xml) => new CertificatesSignInfoModel 216public XElement ToXml() => new XElement( 222public static ItemToSignModel Parse(XElement xml) => new ItemToSignModel 257public XElement ToXml() => new XElement( 263public static StrongNameSignInfoModel Parse(XElement xml) => new StrongNameSignInfoModel
BuildManifest\Model\XElementParsingExtensions.cs (2)
13public static string GetRequiredAttribute(this XElement element, XName name) 24public static Dictionary<string, string> CreateAttributeDictionary(this XElement element)
Microsoft.DotNet.VersionTools.Tasks (1)
BaseDependenciesTask.cs (1)
226XElement.Parse(
Microsoft.DotNet.VersionTools.Tests (21)
BuildManifest\ManifestModelTests.cs (21)
115Action act = () => SigningInformationModel.Parse(XElement.Parse(builder.ToString())); 120SigningInformationModel.Parse(XElement.Parse(builder.ToString())).Should().NotBeNull(); 397XElement xml = XElement.Parse(ExampleBuildString); 399XElement modelXml = model.ToXml(); 407XElement xml = XElement.Parse(ExampleOrchestratedBuildString); 409XElement modelXml = model.ToXml(); 417XElement xml = XElement.Parse( 420XElement modelXml = model.ToXml(); 429XElement modelXml = model.ToXml(); 430XElement xml = XElement.Parse(@"<Build Name=""SimpleBuildManifest"" BuildId=""123""><Package Id=""Foo"" Version=""1.2.3-example"" /></Build>"); 447orchestratedModel.AddParticipantBuild(BuildModel.Parse(XElement.Parse(ExampleBuildString))); 449XElement modelXml = orchestratedModel.ToXml(); 450XElement xml = XElement.Parse(@" 472XElement modelXml = buildModel.ToXml(); 473XElement xml = XElement.Parse(ExampleBuildStringWithSigningInformation);
Microsoft.DotNet.XliffTasks (61)
Model\ResxDocument.cs (4)
18foreach (XElement node in Document.Descendants("data")) 27XElement valueElement = node.Element("value"); 59foreach (XElement node in Document.Descendants("data")) 63XElement valueNodeOfFileRef = node.Element("value");
Model\TranslatableXmlDocument.cs (2)
29private readonly XElement _element; 31public TranslatableXmlElement(string id, string source, string note, XElement element)
Model\VsctDocument.cs (4)
20foreach (XElement strings in Document.Descendants(Document.Root.Name.Namespace + "Strings")) 31foreach (XElement child in strings.Elements()) 64foreach (XElement strings in Document.Descendants(Document.Root.Name.Namespace + "Strings")) 79foreach (XElement imageTag in Document.Descendants(Document.Root.Name.Namespace + "Bitmap"))
Model\XamlRuleDocument.cs (11)
25foreach (XElement? element in Document.Descendants()) 28var descendentDisplayName = element.Elements(XName.Get($"{element.Name.LocalName}.DisplayName", element.Name.NamespaceName)).FirstOrDefault(); 29var descendentDescription = element.Elements(XName.Get($"{element.Name.LocalName}.Description", element.Name.NamespaceName)).FirstOrDefault(); 123var parent = xObject.Parent; 131var grandparent = parent.Parent; 143private static string GenerateIdForPropertyMetadata(XElement element, XAttribute? attribute = null) 145var ancestorWithNameAttributeCandidate = element.Parent?.Parent; // start at grandparent 192private static string? GetComment(XElement element, string attributeName) 208private static string XmlName(XObject container) => container is XElement element ? XmlName(element) : XmlName((XAttribute)container); 209private static string XmlName(XElement element) 218private static string? AttributedName(XElement element) => element.Attribute("Name")?.Value;
Model\XDocumentExtensions.cs (1)
28public static void SelfCloseIfPossible(this XElement element)
Model\XElementExtensions.cs (24)
16/// <param name="transUnitElement">An <see cref="XElement"/> representing the <code>trans-unit</code>.</param> 19public static string GetTargetValue(this XElement transUnitElement) => 27/// <param name="transUnitElement">An <see cref="XElement"/> representing the <code>trans-unit</code>.</param> 29public static void SetTargetValue(this XElement transUnitElement, string value) 31XElement targetElement = transUnitElement.Element(Target); 34XElement sourceElement = transUnitElement.Element(Source); 51/// <param name="transUnitElement">An <see cref="XElement"/> representing the <code>trans-unit</code>.</param> 53public static string GetTargetState(this XElement transUnitElement) => 61/// <param name="transUnitElement">An <see cref="XElement"/> representing the <code>trans-unit</code>.</param> 63public static void SetTargetState(this XElement transUnitElement, string value) 65XElement targetElement = transUnitElement.Element(Target); 68XElement sourceElement = transUnitElement.Element(Source); 88/// <param name="transUnitElement">An <see cref="XElement"/> representing the <code>trans-unit</code>.</param> 90public static string GetSourceValue(this XElement transUnitElement) => 96/// <param name="transUnitElement">An <see cref="XElement"/> representing the <code>trans-unit</code>.</param> 98public static void SetSourceValue(this XElement transUnitElement, string value) => 104/// <param name="transUnitElement">An <see cref="XElement"/> representing the <code>trans-unit</code>.</param> 106public static string GetNoteValue(this XElement transUnitElement) => 114/// <param name="transUnitElement">An <see cref="XElement"/> representing the <code>trans-unit</code>.</param> 116public static void SetNoteValue(this XElement transUnitElement, string value) 118XElement noteElement = transUnitElement.Element(Note); 121XElement priorElement = transUnitElement.Element(Target) ?? transUnitElement.Element(Source); 133/// <param name="transUnitElement">An <see cref="XElement"/> representing the <code>trans-unit</code>.</param> 135public static string GetId(this XElement transUnitElement) =>
Model\XlfDocument.cs (13)
89XElement fileElement = _document.Root.Element(File); 98XElement bodyElement = fileElement.Element(Body); 99XElement groupElement = bodyElement.Element(Group); 108foreach (XElement unitElement in bodyElement.Descendants(TransUnit).ToList()) 187XElement newTransUnit = 195foreach (XElement transUnit in bodyElement.Elements(TransUnit)) 226XElement fileElement = _document.Root.Element(File); 227XElement bodyElement = fileElement.Element(Body); 229IEnumerable<XElement> transUnits = bodyElement.Elements(TransUnit); 235SortedList<string, XElement> sortedTransUnits = new(comparer); 238foreach (XElement transUnit in transUnits) 244foreach (XElement transUnit in sortedTransUnits.Values) 264foreach (XElement element in _document.Descendants(TransUnit))
Tasks\TransformTemplates.cs (2)
77foreach (XElement projectNode in templateXml.Descendants().Where(d => d.Name.LocalName == "Project")) 84foreach (XElement templateItem in templateXml.Descendants().Where(d => d.Name.LocalName == "ProjectItem"))
Microsoft.DotNet.XliffTasks.Tests (11)
XElementExtensionsTests.cs (11)
16XElement transUnitElement = 29XElement transUnitElement = 42XElement transUnitElement = 54XElement transUnitElement = 68XElement transUnitElement = 82XElement transUnitElement = 95XElement transUnitElement = 107XElement transUnitElement = new(TransUnit); 117XElement transUnitElement = 132XElement transUnitElement = 145XElement transUnitElement =
Microsoft.Extensions.FileProviders.Embedded (11)
Manifest\ManifestParser.cs (11)
38var manifest = EnsureElement(document, "Manifest"); 39var manifestVersion = EnsureElement(manifest, "ManifestVersion"); 47var fileSystem = EnsureElement(manifest, "FileSystem"); 51foreach (var element in entries) 80private static ManifestEntry BuildEntry(XElement element) 92var path = EnsureElement(element, "ResourcePath"); 101foreach (var child in element.Elements()) 115private static XElement EnsureElement(XContainer container, string elementName) 117var element = container.Element(elementName); 126private static string EnsureName(XElement element) 137private static string EnsureText(XElement element)
Microsoft.Extensions.FileProviders.Embedded.Tests (1)
Manifest\TestEntry.cs (1)
23public XElement ToXElement() => IsFile ?
netstandard (1)
netstandard.cs (1)
2273[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Xml.Linq.XElement))]
PresentationFramework-SystemXmlLinq (3)
SystemXmlLinqExtension.cs (3)
21XElement xelement = new XElement("Dummy"); 33return item is XElement; 39XName name = ((XElement)item).Name;
ServerComparison.FunctionalTests (1)
ResponseCompressionTests.cs (1)
113var compressionElement = element
SignalR.Client.FunctionalTestApp (7)
src\SignalR\common\Shared\EphemeralDataProtectionProvider.cs (7)
11 private readonly List<XElement> _storedElements = new List<XElement>(); 17 public IReadOnlyCollection<XElement> GetAllElements() 26 private IEnumerable<XElement> GetAllElementsCore() 29 foreach (XElement element in _storedElements) 35 public void StoreElement(XElement element, string friendlyName) 37 var cloned = new XElement(element); // makes a deep copy so caller doesn't inadvertently modify it
System.ComponentModel.TypeConverter (52)
MS\Internal\Xml\Linq\ComponentModel\XComponentModel.cs (52)
44if (typeof(T) == typeof(XElement)) 144internal sealed class XElementAttributePropertyDescriptor : XPropertyDescriptor<XElement, object> 155return _value = new XDeferredSingleton<XAttribute>((e, n) => e.Attribute(n), (component as XElement)!, null); 196internal sealed class XElementDescendantsPropertyDescriptor : XPropertyDescriptor<XElement, IEnumerable<XElement>> 198private XDeferredAxis<XElement>? _value; 207return _value = new XDeferredAxis<XElement>((e, n) => n != null ? e.Descendants(n) : e.Descendants(), (component as XElement)!, null); 218XElement? e = sender as XElement; 225e = sender as XElement; 242XElement? e = sender as XElement; 249internal sealed class XElementElementPropertyDescriptor : XPropertyDescriptor<XElement, object> 251private XDeferredSingleton<XElement>? _value; 252private XElement? _changeState; 260return _value = new XDeferredSingleton<XElement>((e, n) => e.Element(n), (component as XElement)!, null); 270XElement? e = sender as XElement; 277e = sender as XElement; 285e = sender as XElement; 310XElement? e = sender as XElement; 317internal sealed class XElementElementsPropertyDescriptor : XPropertyDescriptor<XElement, IEnumerable<XElement>> 319private XDeferredAxis<XElement>? _value; 328return _value = new XDeferredAxis<XElement>((e, n) => n != null ? e.Elements(n) : e.Elements(), (component as XElement)!, null); 338XElement? e = sender as XElement; 345e = sender as XElement; 353e = sender as XElement; 370XElement? e = sender as XElement; 374e = sender as XElement; 381internal sealed class XElementValuePropertyDescriptor : XPropertyDescriptor<XElement, string> 383private XElement? _element; 396_element = component as XElement; 404_element = component as XElement; 418if (sender is XElement || sender is XText) 433internal sealed class XElementXmlPropertyDescriptor : XPropertyDescriptor<XElement, string> 435private XElement? _element; 443_element = component as XElement; 499private readonly Func<XElement, XName?, IEnumerable<T>> _func; 500internal XElement element; 503public XDeferredAxis(Func<XElement, XName?, IEnumerable<T>> func, XElement element, XName? name) 543private readonly Func<XElement, XName, T?> _func; 544internal XElement element; 547public XDeferredSingleton(Func<XElement, XName, T?> func, XElement element, XName? name)
System.Private.DataContractSerialization (1)
System\Runtime\Serialization\XmlDataContract.cs (1)
371if (type == typeof(System.Xml.Linq.XElement))
System.Private.Xml.Linq (610)
System\Xml\Linq\Extensions.cs (126)
16/// Returns all of the <see cref="XAttribute"/>s for each <see cref="XElement"/> of 17/// this <see cref="IEnumerable"/> of <see cref="XElement"/>. 21/// Attributes for every <see cref="XElement"/> in the target <see cref="IEnumerable"/> 22/// of <see cref="XElement"/>. 24public static IEnumerable<XAttribute> Attributes(this IEnumerable<XElement?> source) 33/// <see cref="XElement"/>'s <see cref="XAttribute"/>s in the target <see cref="IEnumerable"/> 34/// of <see cref="XElement"/> are scanned for a matching <see cref="XName"/>. 38/// Attributes with a matching <see cref="XName"/> for every <see cref="XElement"/> in 39/// the target <see cref="IEnumerable"/> of <see cref="XElement"/>. 41public static IEnumerable<XAttribute> Attributes(this IEnumerable<XElement?> source, XName? name) 49/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the ancestors (parent 50/// and it's parent up to the root) of each of the <see cref="XElement"/>s in this 51/// <see cref="IEnumerable"/> of <see cref="XElement"/>. 54/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the ancestors (parent 55/// and it's parent up to the root) of each of the <see cref="XElement"/>s in this 56/// <see cref="IEnumerable"/> of <see cref="XElement"/>. 58public static IEnumerable<XElement> Ancestors<T>(this IEnumerable<T?> source) where T : XNode 66/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the ancestors (parent 68/// <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 71/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the ancestors (parent 73/// <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 75public static IEnumerable<XElement> Ancestors<T>(this IEnumerable<T?> source, XName? name) where T : XNode 79return name != null ? GetAncestors(source, name, false) : XElement.EmptySequence; 83/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the 84/// <see cref="XElement"/> and it's ancestors (parent and it's parent up to the root). 85/// This is done for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of 86/// <see cref="XElement"/>. 89/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the 90/// <see cref="XElement"/> and it's ancestors (parent and it's parent up to the root). 91/// This is done for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of 92/// <see cref="XElement"/>. 94public static IEnumerable<XElement> AncestorsAndSelf(this IEnumerable<XElement?> source) 102/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the 103/// <see cref="XElement"/> and it's ancestors (parent and it's parent up to the root) 105/// <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 108/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the 109/// <see cref="XElement"/> and it's ancestors (parent and it's parent up to the root) 111/// <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 113public static IEnumerable<XElement> AncestorsAndSelf(this IEnumerable<XElement?> source, XName? name) 117return name != null ? GetAncestors(source, name, true) : XElement.EmptySequence; 160/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the descendants (children 161/// and their children down to the leaf level). This is done for each <see cref="XElement"/> in 162/// this <see cref="IEnumerable"/> of <see cref="XElement"/>. 165/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the descendants (children 166/// and their children down to the leaf level). This is done for each <see cref="XElement"/> in 167/// this <see cref="IEnumerable"/> of <see cref="XElement"/>. 169public static IEnumerable<XElement> Descendants<T>(this IEnumerable<T?> source) where T : XContainer 177/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the descendants (children 179/// for each <see cref="XElement"/> in the target <see cref="IEnumerable"/> of <see cref="XElement"/>. 182/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the descendants (children 184/// for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 186public static IEnumerable<XElement> Descendants<T>(this IEnumerable<T?> source, XName? name) where T : XContainer 190return name != null ? GetDescendants(source, name, false) : XElement.EmptySequence; 194/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the 195/// <see cref="XElement"/> and it's descendants 197/// <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 200/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the 201/// <see cref="XElement"/> and descendants. 203/// <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 205public static IEnumerable<XNode> DescendantNodesAndSelf(this IEnumerable<XElement?> source) 213/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the 214/// <see cref="XElement"/> and it's descendants (children and children's children down 215/// to the leaf nodes). This is done for each <see cref="XElement"/> in this <see cref="IEnumerable"/> 216/// of <see cref="XElement"/>. 219/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the 220/// <see cref="XElement"/> and it's descendants (children and children's children down 221/// to the leaf nodes). This is done for each <see cref="XElement"/> in this <see cref="IEnumerable"/> 222/// of <see cref="XElement"/>. 224public static IEnumerable<XElement> DescendantsAndSelf(this IEnumerable<XElement?> source) 232/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the 233/// <see cref="XElement"/> and it's descendants (children and children's children down 235/// each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 238/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the 239/// <see cref="XElement"/> and it's descendants (children and children's children down 241/// each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 243public static IEnumerable<XElement> DescendantsAndSelf(this IEnumerable<XElement?> source, XName? name) 247return name != null ? GetDescendants(source, name, true) : XElement.EmptySequence; 251/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the child elements 252/// for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 255/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the child elements 256/// for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 258public static IEnumerable<XElement> Elements<T>(this IEnumerable<T?> source) where T : XContainer 266/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the child elements 267/// with a matching for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 270/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the child elements 271/// for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 273public static IEnumerable<XElement> Elements<T>(this IEnumerable<T?> source, XName? name) where T : XContainer 277return name != null ? GetElements(source, name) : XElement.EmptySequence; 281/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the child elements 282/// with a matching for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 285/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the child elements 286/// for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 341private static IEnumerable<XAttribute> GetAttributes(IEnumerable<XElement?> source, XName? name) 343foreach (XElement? e in source) 360private static IEnumerable<XElement> GetAncestors<T>(IEnumerable<T?> source, XName? name, bool self) where T : XNode 366XElement? e = (self ? node : node.parent) as XElement; 370e = e.parent as XElement; 404private static IEnumerable<XElement> GetDescendants<T>(IEnumerable<T?> source, XName? name, bool self) where T : XContainer 412XElement e = (XElement)root; 429XElement? e = n as XElement; 437private static IEnumerable<XElement> GetElements<T>(IEnumerable<T?> source, XName? name) where T : XContainer 449XElement? e = n as XElement;
System\Xml\Linq\XAttribute.cs (8)
114get { return parent != null && ((XElement)parent).lastAttr != this ? next : null; } 143XAttribute a = ((XElement)parent).lastAttr!; 148return a != ((XElement)parent).lastAttr ? a : null; 183((XElement)parent).RemoveAttribute(this); 188/// <seealso cref="XElement.SetValue"/> 189/// <seealso cref="XElement.SetAttributeValue"/> 190/// <seealso cref="XElement.SetElementValue"/> 694if (parent != null) return ((XElement)parent).GetPrefixOfNamespace(ns);
System\Xml\Linq\XContainer.cs (46)
20/// <see cref="XDocument"/> and <see cref="XElement"/>. 239/// applies only for <see cref="XElement"/>. 259/// Returns the descendant <see cref="XElement"/>s of this <see cref="XContainer"/>. Note this method will 260/// not return itself in the resulting IEnumerable. See <see cref="XElement.DescendantsAndSelf()"/> if you 261/// need to include the current <see cref="XElement"/> in the results. 262/// <seealso cref="XElement.DescendantsAndSelf()"/> 265/// An IEnumerable of <see cref="XElement"/> with all of the descendants below this <see cref="XContainer"/> in the XML tree. 267public IEnumerable<XElement> Descendants() 273/// Returns the Descendant <see cref="XElement"/>s with the passed in <see cref="XName"/> as an IEnumerable 276/// <param name="name">The <see cref="XName"/> to match against descendant <see cref="XElement"/>s.</param> 277/// <returns>An <see cref="IEnumerable"/> of <see cref="XElement"/></returns> 278public IEnumerable<XElement> Descendants(XName? name) 280return name != null ? GetDescendants(name, false) : XElement.EmptySequence; 292/// An <see cref="XElement"/> child that matches the <see cref="XName"/> passed in, or null. 294public XElement? Element(XName name) 302XElement? e = n as XElement; 310/// Returns the child <see cref="XElement"/>s of this <see cref="XContainer"/>. 316/// An <see cref="IEnumerable"/> over all of this <see cref="XContainer"/>'s child <see cref="XElement"/>s. 318public IEnumerable<XElement> Elements() 327/// The <see cref="XName"/> to match against the <see cref="XElement"/> children of this <see cref="XContainer"/>. 330/// An <see cref="IEnumerable"/> of <see cref="XElement"/> children of this <see cref="XContainer"/> that have 333public IEnumerable<XElement> Elements(XName? name) 335return name != null ? GetElements(name) : XElement.EmptySequence; 341/// <seealso cref="XElement.Attributes()"/> 346/// <seealso cref="XElement.Attributes()"/> 364/// methods does not remove attributes. See <see cref="XElement.RemoveAttributes()"/>. 365/// <seealso cref="XElement.RemoveAttributes()"/> 385if (this is XElement) 554if (this is XElement) 766internal IEnumerable<XElement> GetDescendants(XName? name, bool self) 770XElement e = (XElement)this; 787XElement? e = n as XElement; 793private IEnumerable<XElement> GetElements(XName? name) 801XElement? e = n as XElement; 906XElement e = new XElement(_eCache.Get(r.NamespaceURI).GetName(r.LocalName)); 960XElement e = new XElement(_eCache.Get(r.NamespaceURI).GetName(r.LocalName)); 1020XElement e = new XElement(_eCache.Get(r.NamespaceURI).GetName(r.LocalName)); 1058XElement? e = _currentContainer as XElement; 1134XElement e = new XElement(_eCache.Get(r.NamespaceURI).GetName(r.LocalName)); 1174XElement? e = _currentContainer as XElement;
System\Xml\Linq\XDocument.cs (2)
149public XElement? Root 153return GetFirstNode<XElement>();
System\Xml\Linq\XElement.cs (257)
26/// An <see cref="XElement"/> can contain the following types of content: 29/// <item><see cref="XElement"/></item> 41public static IEnumerable<XElement> EmptySequence 45return Array.Empty<XElement>(); 106public XElement(XElement other) 162internal static async Task<XElement> CreateAsync(XmlReader r, CancellationToken cancellationToken) 164XElement xe = new XElement(default(AsyncConstructionSentry)); 170/// Outputs this <see cref="XElement"/>'s underlying XML tree. The output can 175/// Output this <see cref="XElement"/> to a file. 180/// <see cref="XElement.Save(string, SaveOptions)"/>) enabling 194/// Output this <see cref="XElement"/> to a file. 240if (n is XElement) return true; 323/// Returns this <see cref="XElement"/> and all of it's ancestors up 329/// Returns this <see cref="XElement"/> and all of it's ancestors up to 334/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing all of 335/// this <see cref="XElement"/>'s ancestors up to the root node (including 336/// this <see cref="XElement"/>. 338public IEnumerable<XElement> AncestorsAndSelf() 344/// Returns the ancestor(s) of this <see cref="XElement"/> with the matching 345/// <see cref="XName"/>. If this <see cref="XElement"/>'s <see cref="XName"/> 347/// resulting <see cref="IEnumerable"/> or <see cref="XElement"/>. 354/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the 355/// ancestors of this <see cref="XElement"/> with a matching <see cref="XName"/>. 357public IEnumerable<XElement> AncestorsAndSelf(XName? name) 359return name != null ? GetAncestors(name, true) : XElement.EmptySequence; 363/// Returns the <see cref="XAttribute"/> associated with this <see cref="XElement"/> that has this 388/// Returns the <see cref="XAttribute"/> associated with this <see cref="XElement"/>. Optionally 392/// Returns all of the <see cref="XAttribute"/>s associated with this <see cref="XElement"/>. 397/// associated with this <see cref="XElement"/>. 405/// Returns the <see cref="XAttribute"/>(s) associated with this <see cref="XElement"/> that has the passed 407/// <seealso cref="XElement.Attributes()"/> 421/// Get the self and descendant nodes for an <see cref="XElement"/> 430/// Returns this <see cref="XElement"/> and all of it's descendants. Overloads allow 432/// of a descendant <see cref="XElement"/> to match. 435/// Returns this <see cref="XElement"/> and all of it's descendant <see cref="XElement"/>s 436/// as an <see cref="IEnumerable"/> of <see cref="XElement"/>. 437/// <seealso cref="XElement.DescendantsAndSelf()"/> 440/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing this <see cref="XElement"/> 443public IEnumerable<XElement> DescendantsAndSelf() 449/// Returns the descendants of this <see cref="XElement"/> that have a matching <see cref="XName"/> 450/// to the one passed in, including, potentially, this <see cref="XElement"/>. 451/// <seealso cref="XElement.DescendantsAndSelf(XName)"/> 454/// The <see cref="XName"/> of the descendant <see cref="XElement"/> that is being targeted. 457/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing all of the descendant 458/// <see cref="XElement"/>s that have this <see cref="XName"/>. 460public IEnumerable<XElement> DescendantsAndSelf(XName? name) 462return name != null ? GetDescendants(name, true) : XElement.EmptySequence; 466/// Returns the default <see cref="XNamespace"/> of an <see cref="XElement"/> 475/// Get the namespace associated with a particular prefix for this <see cref="XElement"/> 501XElement? e = this; 528e = e.parent as XElement; 544/// <see cref="XElement"/> and initializing it from a data source containing 550/// <seealso cref="XElement.Parse(string)"/> 553/// Create a new <see cref="XElement"/> based on the contents of the file 555/// <see cref="XElement.Parse(string)"/> to create an <see cref="XElement"/> from 558/// <seealso cref="XElement.Parse(string)"/> 567/// A URI string referencing the file to load into a new <see cref="XElement"/>. 570/// An <see cref="XElement"/> initialized with the contents of the file referenced 573public static XElement Load([StringSyntax(StringSyntaxAttribute.Uri)] string uri) 579/// Create a new <see cref="XElement"/> based on the contents of the file 592/// A string representing the URI of the file to be loaded into a new <see cref="XElement"/>. 598/// An <see cref="XElement"/> initialized with the contents of the file referenced 602public static XElement Load([StringSyntax(StringSyntaxAttribute.Uri)] string uri, LoadOptions options) 612/// Create a new <see cref="XElement"/> and initialize its underlying XML tree using 617/// created <see cref="XElement"/>. 620/// A new <see cref="XElement"/> containing the contents of the passed in 623public static XElement Load(Stream stream) 629/// Create a new <see cref="XElement"/> and initialize its underlying XML tree using 640/// created <see cref="XElement"/>. 646/// A new <see cref="XElement"/> containing the contents of the passed in 649public static XElement Load(Stream stream, LoadOptions options) 659/// Create a new <see cref="XElement"/> and initialize its underlying XML tree using 670/// created <see cref="XElement"/>. 678/// A new <see cref="XElement"/> containing the contents of the passed in 681public static async Task<XElement> LoadAsync(Stream stream, LoadOptions options, CancellationToken cancellationToken) 694/// Create a new <see cref="XElement"/> and initialize its underlying XML tree using 699/// created <see cref="XElement"/>. 702/// A new <see cref="XElement"/> containing the contents of the passed in 705public static XElement Load(TextReader textReader) 711/// Create a new <see cref="XElement"/> and initialize its underlying XML tree using 722/// created <see cref="XElement"/>. 728/// A new <see cref="XElement"/> containing the contents of the passed in 731public static XElement Load(TextReader textReader, LoadOptions options) 741/// Create a new <see cref="XElement"/> and initialize its underlying XML tree using 752/// created <see cref="XElement"/>. 760/// A new <see cref="XElement"/> containing the contents of the passed in 763public static async Task<XElement> LoadAsync(TextReader textReader, LoadOptions options, CancellationToken cancellationToken) 776/// Create a new <see cref="XElement"/> containing the contents of the 781/// <see cref="XElement"/>. 784/// A new <see cref="XElement"/> containing the contents of the passed 787public static XElement Load(XmlReader reader) 793/// Create a new <see cref="XElement"/> containing the contents of the 798/// <see cref="XElement"/>. 804/// A new <see cref="XElement"/> containing the contents of the passed 807public static XElement Load(XmlReader reader, LoadOptions options) 812XElement e = new XElement(reader, options); 819/// Create a new <see cref="XElement"/> containing the contents of the 824/// <see cref="XElement"/>. 832/// A new <see cref="XElement"/> containing the contents of the passed 835public static Task<XElement> LoadAsync(XmlReader reader, LoadOptions options, CancellationToken cancellationToken) 840return Task.FromCanceled<XElement>(cancellationToken); 844private static async Task<XElement> LoadAsyncInternal(XmlReader reader, LoadOptions options, CancellationToken cancellationToken) 848XElement e = new XElement(default(AsyncConstructionSentry)); 859/// Parses a string containing XML into an <see cref="XElement"/>. Optionally 863/// Parses a string containing XML into an <see cref="XElement"/>. 869/// A string containing the XML to parse into an <see cref="XElement"/>. 872/// An <see cref="XElement"/> created from the XML string passed in. 874public static XElement Parse(string text) 880/// Parses a string containing XML into an <see cref="XElement"/> and optionally 894/// A string containing the XML to parse into an <see cref="XElement"/>. 900/// An <see cref="XElement"/> created from the XML string passed in. 902public static XElement Parse(string text, LoadOptions options) 915/// Removes content and attributes from this <see cref="XElement"/>. 916/// <seealso cref="XElement.RemoveAttributes"/> 926/// Removes that attributes of this <see cref="XElement"/>. 927/// <seealso cref="XElement.RemoveAll"/> 928/// <seealso cref="XElement.RemoveAttributes"/> 1032/// Output this <see cref="XElement"/> to the passed in <see cref="Stream"/>. 1037/// <see cref="XElement.Save(Stream, SaveOptions)"/>) enabling 1043/// The <see cref="Stream"/> to output this <see cref="XElement"/> to. 1051/// Output this <see cref="XElement"/> to a <see cref="Stream"/>. 1070/// Output this <see cref="XElement"/> to a <see cref="Stream"/>. 1094/// Output this <see cref="XElement"/> to the passed in <see cref="TextWriter"/>. 1099/// <see cref="XElement.Save(TextWriter, SaveOptions)"/>) enabling 1105/// The <see cref="TextWriter"/> to output this <see cref="XElement"/> to. 1113/// Output this <see cref="XElement"/> to a <see cref="TextWriter"/>. 1132/// Output this <see cref="XElement"/> to a <see cref="TextWriter"/>. 1156/// Output this <see cref="XElement"/> to an <see cref="XmlWriter"/>. 1171/// Output this <see cref="XElement"/> to an <see cref="XmlWriter"/>. 1201/// <seealso cref="XElement.SetElementValue"/> 1202/// <seealso cref="XElement.SetValue"/> 1241/// <seealso cref="XElement.SetAttributeValue"/> 1242/// <seealso cref="XElement.SetValue"/> 1257XElement? e = Element(name); 1278/// <seealso cref="XElement.SetAttributeValue"/> 1279/// <seealso cref="XElement.SetElementValue"/> 1296/// Write this <see cref="XElement"/> to the passed in <see cref="XmlWriter"/>. 1299/// The <see cref="XmlWriter"/> to write this <see cref="XElement"/> to. 1309/// Write this <see cref="XElement"/> to the passed in <see cref="XmlTextWriter"/>. 1312/// The <see cref="XmlTextWriter"/> to write this <see cref="XElement"/> to. 1325/// Cast the value of this <see cref="XElement"/> to a <see cref="string"/>. 1328/// If the <see cref="XElement"/> is a subtree (an <see cref="XElement"/> 1329/// that has <see cref="XElement"/> children. The concatenated string 1330/// value of all of the <see cref="XElement"/>'s text and descendants 1334/// The <see cref="XElement"/> to cast to a string. 1337/// The content of this <see cref="XElement"/> as a <see cref="string"/>. 1341public static explicit operator string?(XElement? element) 1348/// Cast the value of this <see cref="XElement"/> to a <see cref="bool"/>. 1351/// The <see cref="XElement"/> to cast to <see cref="bool"/>. 1354/// The content of this <see cref="XElement"/> as a <see cref="bool"/>. 1363public static explicit operator bool(XElement element) 1371/// Cast the value of this <see cref="XElement"/> to a <see cref="bool"/>?. 1374/// The <see cref="XElement"/> to cast to <see cref="bool"/>?. 1377/// The content of this <see cref="XElement"/> as a <see cref="bool"/>?. 1384public static explicit operator bool?(XElement? element) 1391/// Cast the value of this <see cref="XElement"/> to an <see cref="int"/>. 1394/// The <see cref="XElement"/> to cast to <see cref="int"/>. 1397/// The content of this <see cref="XElement"/> as a <see cref="int"/>. 1406public static explicit operator int(XElement element) 1414/// Cast the value of this <see cref="XElement"/> to an <see cref="int"/>?. 1417/// The <see cref="XElement"/> to cast to <see cref="int"/>?. 1420/// The content of this <see cref="XElement"/> as a <see cref="int"/>?. 1427public static explicit operator int?(XElement? element) 1434/// Cast the value of this <see cref="XElement"/> to an <see cref="uint"/>. 1437/// The <see cref="XElement"/> to cast to <see cref="uint"/>. 1440/// The content of this <see cref="XElement"/> as a <see cref="uint"/>. 1449public static explicit operator uint(XElement element) 1457/// Cast the value of this <see cref="XElement"/> to an <see cref="uint"/>?. 1460/// The <see cref="XElement"/> to cast to <see cref="uint"/>?. 1463/// The content of this <see cref="XElement"/> as a <see cref="uint"/>?. 1470public static explicit operator uint?(XElement? element) 1477/// Cast the value of this <see cref="XElement"/> to a <see cref="long"/>. 1480/// The <see cref="XElement"/> to cast to <see cref="long"/>. 1483/// The content of this <see cref="XElement"/> as a <see cref="long"/>. 1492public static explicit operator long(XElement element) 1500/// Cast the value of this <see cref="XElement"/> to a <see cref="long"/>?. 1503/// The <see cref="XElement"/> to cast to <see cref="long"/>?. 1506/// The content of this <see cref="XElement"/> as a <see cref="long"/>?. 1513public static explicit operator long?(XElement? element) 1520/// Cast the value of this <see cref="XElement"/> to an <see cref="ulong"/>. 1523/// The <see cref="XElement"/> to cast to <see cref="ulong"/>. 1526/// The content of this <see cref="XElement"/> as a <see cref="ulong"/>. 1535public static explicit operator ulong(XElement element) 1543/// Cast the value of this <see cref="XElement"/> to an <see cref="ulong"/>?. 1546/// The <see cref="XElement"/> to cast to <see cref="ulong"/>?. 1549/// The content of this <see cref="XElement"/> as a <see cref="ulong"/>?. 1556public static explicit operator ulong?(XElement? element) 1563/// Cast the value of this <see cref="XElement"/> to a <see cref="float"/>. 1566/// The <see cref="XElement"/> to cast to <see cref="float"/>. 1569/// The content of this <see cref="XElement"/> as a <see cref="float"/>. 1578public static explicit operator float(XElement element) 1586/// Cast the value of this <see cref="XElement"/> to an <see cref="float"/>?. 1589/// The <see cref="XElement"/> to cast to <see cref="float"/>?. 1592/// The content of this <see cref="XElement"/> as a <see cref="float"/>?. 1599public static explicit operator float?(XElement? element) 1606/// Cast the value of this <see cref="XElement"/> to a <see cref="double"/>. 1609/// The <see cref="XElement"/> to cast to <see cref="double"/>. 1612/// The content of this <see cref="XElement"/> as a <see cref="double"/>. 1621public static explicit operator double(XElement element) 1629/// Cast the value of this <see cref="XElement"/> to an <see cref="double"/>?. 1632/// The <see cref="XElement"/> to cast to <see cref="double"/>?. 1635/// The content of this <see cref="XElement"/> as a <see cref="double"/>?. 1642public static explicit operator double?(XElement? element) 1649/// Cast the value of this <see cref="XElement"/> to a <see cref="decimal"/>. 1652/// The <see cref="XElement"/> to cast to <see cref="decimal"/>. 1655/// The content of this <see cref="XElement"/> as a <see cref="decimal"/>. 1664public static explicit operator decimal(XElement element) 1672/// Cast the value of this <see cref="XElement"/> to an <see cref="decimal"/>?. 1675/// The <see cref="XElement"/> to cast to <see cref="decimal"/>?. 1678/// The content of this <see cref="XElement"/> as a <see cref="decimal"/>?. 1685public static explicit operator decimal?(XElement? element) 1692/// Cast the value of this <see cref="XElement"/> to a <see cref="DateTime"/>. 1695/// The <see cref="XElement"/> to cast to <see cref="DateTime"/>. 1698/// The content of this <see cref="XElement"/> as a <see cref="DateTime"/>. 1707public static explicit operator DateTime(XElement element) 1715/// Cast the value of this <see cref="XElement"/> to an <see cref="DateTime"/>?. 1718/// The <see cref="XElement"/> to cast to <see cref="DateTime"/>?. 1721/// The content of this <see cref="XElement"/> as a <see cref="DateTime"/>?. 1728public static explicit operator DateTime?(XElement? element) 1735/// Cast the value of this <see cref="XElement"/> to a <see cref="DateTimeOffset"/>. 1738/// The <see cref="XElement"/> to cast to <see cref="DateTimeOffset"/>. 1741/// The content of this <see cref="XElement"/> as a <see cref="DateTimeOffset"/>. 1750public static explicit operator DateTimeOffset(XElement element) 1758/// Cast the value of this <see cref="XElement"/> to an <see cref="DateTimeOffset"/>?. 1761/// The <see cref="XElement"/> to cast to <see cref="DateTimeOffset"/>?. 1764/// The content of this <see cref="XElement"/> as a <see cref="DateTimeOffset"/>?. 1771public static explicit operator DateTimeOffset?(XElement? element) 1778/// Cast the value of this <see cref="XElement"/> to a <see cref="TimeSpan"/>. 1781/// The <see cref="XElement"/> to cast to <see cref="TimeSpan"/>. 1784/// The content of this <see cref="XElement"/> as a <see cref="TimeSpan"/>. 1793public static explicit operator TimeSpan(XElement element) 1801/// Cast the value of this <see cref="XElement"/> to an <see cref="TimeSpan"/>?. 1804/// The <see cref="XElement"/> to cast to <see cref="TimeSpan"/>?. 1807/// The content of this <see cref="XElement"/> as a <see cref="TimeSpan"/>?. 1814public static explicit operator TimeSpan?(XElement? element) 1821/// Cast the value of this <see cref="XElement"/> to a <see cref="Guid"/>. 1824/// The <see cref="XElement"/> to cast to <see cref="Guid"/>. 1827/// The content of this <see cref="XElement"/> as a <see cref="Guid"/>. 1836public static explicit operator Guid(XElement element) 1844/// Cast the value of this <see cref="XElement"/> to an <see cref="Guid"/>?. 1847/// The <see cref="XElement"/> to cast to <see cref="Guid"/>?. 1850/// The content of this <see cref="XElement"/> as a <see cref="Guid"/>?. 1857public static explicit operator Guid?(XElement? element) 1872/// Generates a <see cref="XElement"/> from its XML representation. 1875/// The <see cref="XmlReader"/> stream from which the <see cref="XElement"/> 1888/// Converts a <see cref="XElement"/> into its XML representation. 1891/// The <see cref="XmlWriter"/> stream to which the <see cref="XElement"/> 1936private bool AttributesEqual(XElement e) 1960XElement? e = node as XElement; 1977private string? GetNamespaceOfPrefixInScope(string prefix, XElement? outOfScope) 1979XElement? e = this; 1993e = e.parent as XElement;
System\Xml\Linq\XLinq.cs (14)
45if (_parent is XElement) 206public void WriteElement(XElement e) 209XElement root = e; 213XElement? current = n as XElement; 250public async Task WriteElementAsync(XElement e, CancellationToken cancellationToken) 253XElement root = e; 257XElement? current = n as XElement; 306private void PushAncestors(XElement? e) 310e = e!.parent as XElement; 327private void PushElement(XElement e) 370private void WriteStartElement(XElement e) 389private async Task WriteStartElementAsync(XElement e, CancellationToken cancellationToken)
System\Xml\Linq\XNode.cs (22)
21/// <see cref="XElement"/>, 191public IEnumerable<XElement> Ancestors() 208public IEnumerable<XElement> Ancestors(XName? name) 210return name != null ? GetAncestors(name, false) : XElement.EmptySequence; 348public IEnumerable<XElement> ElementsAfterSelf() 362public IEnumerable<XElement> ElementsAfterSelf(XName? name) 364return name != null ? GetElementsAfterSelf(name) : XElement.EmptySequence; 374public IEnumerable<XElement> ElementsBeforeSelf() 388public IEnumerable<XElement> ElementsBeforeSelf(XName? name) 390return name != null ? GetElementsBeforeSelf(name) : XElement.EmptySequence; 501return await XElement.CreateAsync(reader, cancellationToken).ConfigureAwait(false); 594/// <see cref="XElement"/> nodes are equal if they have the same tag name, the same 630internal IEnumerable<XElement> GetAncestors(XName? name, bool self) 632XElement? e = (self ? this : parent) as XElement; 636e = e.parent as XElement; 640private IEnumerable<XElement> GetElementsAfterSelf(XName? name) 646XElement? e = n as XElement; 651private IEnumerable<XElement> GetElementsBeforeSelf(XName? name) 660XElement? e = n as XElement;
System\Xml\Linq\XNodeBuilder.cs (3)
110_parent = ((XElement)_parent!).parent; 139XElement e = (XElement)_parent!;
System\Xml\Linq\XNodeEqualityComparer.cs (2)
28/// <see cref="XElement"/> nodes are equal if they have the same tag name, the same 67/// <see cref="XElement"/> nodes are equal if they have the same tag name, the same
System\Xml\Linq\XNodeReader.cs (64)
45XElement? e = GetElementInAttributeScope(); 133XElement? e = GetElementInAttributeScope(); 188XElement? e = _source as XElement; 204XElement? e = _source as XElement; 251XElement? e = _source as XElement; 319XElement? e = _source as XElement; 396XElement? e = GetElementInScope(); 407e = e.parent as XElement; 422XElement? e = GetElementInScope(); 441e = e.parent as XElement; 470XElement? e = GetElementInAttributeScope(); 516XElement? e = GetElementInAttributeScope(); 562XElement? e = GetElementInAttributeScope(); 594XElement? e = GetElementInScope(); 612XElement? e = GetElementInAttributeScope(); 650XElement? e = GetElementInAttributeScope(); 698XElement? e = GetElementInAttributeScope(); 752XElement? e = GetElementInAttributeScope(); 782XElement? e = _source as XElement; 818if (a.parent != null && ((XElement)a.parent).lastAttr != a) 883XElement? c = _source as XElement; 890foreach (XElement e in c.Descendants()) 908XElement? e = _source as XElement; 933foreach (XElement e in n.ElementsAfterSelf()) 943if (n.parent is XElement) 952if (_parent is XElement) 983XElement? e = _source as XElement; 1008XElement? e = _source as XElement; 1038XElement? e = _source as XElement; 1080private XElement? GetElementInAttributeScope() 1082XElement? e = _source as XElement; 1094return (XElement?)a.parent; 1099return (XElement?)a.parent; 1104private XElement? GetElementInScope() 1106XElement? e = _source as XElement; 1114return n.parent as XElement; 1119return (XElement?)a.parent; 1121e = _parent as XElement; 1129return (XElement?)a.parent; 1134private static void GetNameInAttributeScope(string? qualifiedName, XElement e, out string? localName, out string? namespaceName) 1162XElement? e = _source as XElement; 1205private bool ReadIntoElement(XElement e) 1240XElement? e = (XElement?)a.parent; 1278if (_parent is XElement) 1333XElement? element = candidateAttribute.parent as XElement; 1339element = element.parent as XElement; 1374element = element.parent as XElement; 1392XElement? e = candidate.parent as XElement;
System\Xml\Linq\XObject.cs (4)
66/// Gets the parent <see cref="XElement"/> of this <see cref="XObject"/>. 69/// If this <see cref="XObject"/> has no parent <see cref="XElement"/>, this property returns null. 71public XElement? Parent 73get { return parent as XElement; }
System\Xml\Schema\XNodeValidator.cs (16)
83ValidateElement((XElement)source); 171private void PushAncestorsAndSelf(XElement? e) 195e = e.parent as XElement; 199private void PushElement(XElement e, ref string? xsiType, ref string? xsiNil) 259private void ValidateAttributes(XElement e) 296private void ValidateElement(XElement e) 322private void ValidateNodes(XElement e) 331XElement? c = n as XElement; 435/// Gets the schema information that has been assigned to the <see cref="XElement"/> as a result of schema validation. 438public static IXmlSchemaInfo? GetSchemaInfo(this XElement source) 489/// Validate a <see cref="XElement"/> 499public static void Validate(this XElement source, XmlSchemaObject partialValidationType, XmlSchemaSet schemas, ValidationEventHandler? validationEventHandler) 505/// Validate a <see cref="XElement"/> 515/// <param name="addSchemaInfo">If enabled the <see cref="XElement"/> and the corresponding 518public static void Validate(this XElement source, XmlSchemaObject partialValidationType, XmlSchemaSet schemas, ValidationEventHandler? validationEventHandler, bool addSchemaInfo)
System\Xml\XPath\XNodeNavigator.cs (46)
47private XElement? _parent; 84XElement? element = _source as XElement; 122XElement? e = _source as XElement; 134XElement? e = _source as XElement; 176XElement? e = _source as XElement; 232XElement? e = _source as XElement; 275return ((XElement)_source).Value; 279XElement? root = ((XDocument)_source).Root; 325XElement? e = _source as XElement; 347foreach (XElement element in c.Elements()) 384XElement? e = _source as XElement; 418XElement? e = _source as XElement; 456XElement? e = _source as XElement; 523foreach (XElement element in currentNode.ElementsAfterSelf()) 573XElement? e = (XElement?)currentAttribute.GetParent(); 750if (c.GetParent() != null || c is XElement) 772private static XAttribute? GetFirstNamespaceDeclarationGlobal(XElement e) 774XElement? ce = e; 787private static XAttribute? GetFirstNamespaceDeclarationLocal(XElement e) 801XElement? e = (XElement?)a.GetParent(); 821XElement? e = a.Parent; 848private static bool HasNamespaceDeclarationInScope(XAttribute a, XElement e) 851XElement? ce = e; 966/// Select an <see cref="XElement"/> using a XPath expression 970/// <returns>An <see cref="XElement"> or null</see></returns> 971public static XElement? XPathSelectElement(this XNode node, string expression) 977/// Select an <see cref="XElement"/> using a XPath expression 983/// <returns>An <see cref="XElement"> or null</see></returns> 984public static XElement? XPathSelectElement(this XNode node, string expression, IXmlNamespaceResolver? resolver) 990/// Select a set of <see cref="XElement"/> using a XPath expression 995public static IEnumerable<XElement> XPathSelectElements(this XNode node, string expression) 1001/// Select a set of <see cref="XElement"/> using a XPath expression 1008public static IEnumerable<XElement> XPathSelectElements(this XNode node, string expression, IXmlNamespaceResolver? resolver) 1012return (IEnumerable<XElement>)XPathEvaluator.Evaluate<XElement>(node, expression, resolver);
System.Xml.Linq (1)
System.Xml.Linq.cs (1)
15[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Xml.Linq.XElement))]
System.Xml.XDocument (1)
artifacts\obj\System.Xml.XDocument\Debug\net9.0\System.Xml.XDocument.Forwards.cs (1)
14[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Xml.Linq.XElement))]
WorkloadBuildTasks (4)
PatchNuGetConfig.cs (4)
93XElement? packageSources = doc.XPathSelectElement(xpath); 97var newPackageSourceElement = new XElement("add", 112XElement? packageSourceMapping = doc.XPathSelectElement(mappingXpath); 122var newPackageSourceMappingElement = new XElement("packageSource",
XmlFileLogger (22)
ILogNode.cs (1)
19void SaveToElement(XElement parentElement);
LogProcessNode.cs (7)
78public abstract void SaveToElement(XElement parentElement); 124protected void WriteProperties(XElement parentElement) 128var propElement = new XElement("Properties"); 143protected void WriteChildren<T>(XElement parentElement) where T : ILogNode 158protected void WriteChildren<T>(XElement parentElement, Func<XElement> subNodeFactory) where T : ILogNode 162var node = subNodeFactory();
ObjectModel\Build.cs (2)
47var root = new XElement("Build", 64public override void SaveToElement(XElement parentElement)
ObjectModel\Item.cs (3)
69public void SaveToElement(XElement parentElement, string xmlAttributeName, bool collapseSingleItem) 71var element = new XElement("Item"); 79var metadataElement = new XElement(metadataItem.Key);
ObjectModel\Message.cs (1)
34public void SaveToElement(XElement element)
ObjectModel\Project.cs (2)
88public override void SaveToElement(XElement parentElement) 98var element = new XElement("Project",
ObjectModel\Target.cs (2)
33public override void SaveToElement(XElement parentElement) 35var element = new XElement("Target",
ObjectModel\Task.cs (2)
47public override void SaveToElement(XElement element) 49var task = new XElement("Task",
ObjectModel\TaskParameter.cs (2)
44public void SaveToElement(XElement parentElement) 46XElement element = new XElement(name);
xunit.console (10)
ConsoleRunner.cs (5)
272XElement assembliesElement = null; 289foreach (var assemblyElement in results.Where(result => result != null)) 296var assemblyElement = ExecuteAssembly(consoleLock, assembly, serialize, needsXml, parallelizeTestCollections, maxThreadCount, diagnosticMessages, noColor, appDomains, failSkips, stopOnFail, project.Filters, internalDiagnosticMessages); 317XElement ExecuteAssembly(object consoleLock, 334var assemblyElement = needsXml ? new XElement("assembly") : null;
Utility\Transform.cs (1)
13public Action<XElement, string> OutputHandler;
Utility\TransformFactory.cs (4)
59public static List<Action<XElement>> GetXmlTransformers(XunitProject project) 61.Select(output => new Action<XElement>(xml => instance.availableTransforms[output.Key].OutputHandler(xml, output.Value))) 64static void Handler_DirectWrite(XElement xml, string outputFileName) 70static void Handler_XslTransform(string key, string resourceName, XElement xml, string outputFileName)