5 types derived from XNode
System.Private.Xml.Linq (5)
System\Xml\Linq\XComment.cs (1)
12public class XComment : XNode
System\Xml\Linq\XContainer.cs (1)
22public abstract class XContainer : XNode
System\Xml\Linq\XDocumentType.cs (1)
13public class XDocumentType : XNode
System\Xml\Linq\XProcessingInstruction.cs (1)
12public class XProcessingInstruction : XNode
System\Xml\Linq\XText.cs (1)
13public class XText : XNode
380 references to XNode
ConfigurationSchemaGenerator (1)
ConfigSchemaEmitter.cs (1)
503private static string GetNodeText(XNode node)
ConfigurationSchemaGenerator.Tests (1)
GeneratorTests.cs (1)
163return (XElement)XNode.ReadFrom(reader);
GenerateDocumentationAndConfigFiles (1)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
143foreach (var node in childNode.Nodes())
Microsoft.AspNetCore.OpenApi.SourceGenerators (14)
XmlComments\XmlComment.cs (2)
178private static void ResolveCrefLink(Compilation compilation, XNode node, string elementName) 210private static void ResolveLangKeyword(XNode node, string elementName)
XmlComments\XmlComment.InheritDoc.cs (12)
95private static XNode[] RewriteMany(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XNode[] nodes, CancellationToken cancellationToken) 97var result = new List<XNode>(); 98foreach (var child in nodes) 106private static XNode[] RewriteInheritdocElements(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XNode node, CancellationToken cancellationToken) 142private static XNode[]? RewriteInheritdocElement(ISymbol memberSymbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XElement element, CancellationToken cancellationToken) 374where TNode : XNode 376XNode copy; 425private static XNode[]? TrySelectNodes(XNode node, string xpath) 432return xpathResult?.Cast<XNode>().ToArray();
Microsoft.Build.Tasks.Core (1)
RoslynCodeTaskFactory\RoslynCodeTaskFactory.cs (1)
351foreach (XNode node in document.Root.Nodes()
Microsoft.CodeAnalysis (3)
InternalUtilities\XmlUtilities.cs (3)
17where TNode : XNode 19XNode copy; 68internal static XElement[]? TrySelectElements(XNode node, string xpath, out string? errorMessage, out bool invalidXPath)
Microsoft.CodeAnalysis.Analyzers (1)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
143foreach (var node in childNode.Nodes())
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
143foreach (var node in childNode.Nodes())
Microsoft.CodeAnalysis.CSharp (22)
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (22)
125foreach (XNode node in expander.Rewrite(doc, currentXmlFilePath: null, originatingSyntax: null)) 147private XNode[] RewriteMany(XNode[] nodes, string currentXmlFilePath, CSharpSyntaxNode originatingSyntax) 151ArrayBuilder<XNode> builder = null; 152foreach (XNode child in nodes) 156builder = ArrayBuilder<XNode>.GetInstance(); 167return builder == null ? Array.Empty<XNode>() : builder.ToArrayAndFree(); 171private XNode[] Rewrite(XNode node, string currentXmlFilePath, CSharpSyntaxNode originatingSyntax) 182XNode[] rewritten = RewriteIncludeElement(element, currentXmlFilePath, originatingSyntax, out commentMessage); 194return new XNode[] { node.Copy(copyAttributeAnnotations: false) }; 197IEnumerable<XNode> oldNodes = container.Nodes(); 206XNode[] rewritten = RewriteMany(oldNodes.ToArray(), currentXmlFilePath, originatingSyntax); 243return new XNode[] { container }; // Already copied. 248return new XNode[] { failureComment, container }; // Already copied. 266private XNode[] RewriteIncludeElement(XElement includeElement, string currentXmlFilePath, CSharpSyntaxNode originatingSyntax, out string commentMessage) 289return new XNode[] { new XComment(commentMessage), includeElement.Copy(copyAttributeAnnotations: false) }; 370return new XNode[] { new XComment(commentMessage) }; 375return Array.Empty<XNode>(); 382XNode[] result = RewriteMany(loadedElements, resolvedFilePath, originatingSyntax); 412return new XNode[] { new XComment(commentMessage) }; 417return Array.Empty<XNode>();
Microsoft.CodeAnalysis.Features (2)
DocumentationComments\AbstractDocumentationCommentFormattingService.cs (2)
317private static void AppendTextFromNode(FormatterState state, XNode node, Compilation compilation) 432foreach (var childNode in element.Nodes())
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
143foreach (var node in childNode.Nodes())
Microsoft.CodeAnalysis.VisualBasic (23)
Compilation\DocumentationComments\DocumentationCommentCompiler.Includes.vb (23)
248Private Function RewriteMany(nodes As XNode(), currentXmlFilePath As String, originatingSyntax As XmlNodeSyntax) As XNode() 251Dim builder As ArrayBuilder(Of XNode) = Nothing 254builder = ArrayBuilder(Of XNode).GetInstance() 264Return If(builder Is Nothing, Array.Empty(Of XNode)(), builder.ToArrayAndFree()) 267Private Function Rewrite(node As XNode, currentXmlFilePath As String, originatingSyntax As XmlNodeSyntax) As XNode() 275Dim rewritten As XNode() = RewriteIncludeElement(element, currentXmlFilePath, originatingSyntax, commentMessage) 285Return New XNode() {node.Copy(copyAttributeAnnotations:=True)} 288Dim oldNodes As IEnumerable(Of XNode) = container.Nodes 296Dim rewritten As XNode() = RewriteMany(oldNodes.ToArray(), currentXmlFilePath, originatingSyntax) 425Return New XNode() {container} 427Return New XNode() {New XComment(commentMessage), container} 441Private Function RewriteIncludeElement(includeElement As XElement, currentXmlFilePath As String, originatingSyntax As XmlNodeSyntax, <Out> ByRef commentMessage As String) As XNode() 454Return New XNode() {New XComment(commentMessage)} 475Return New XNode() {New XComment(commentMessage)} 484Return New XNode() {New XComment(commentMessage)} 490Return New XNode() {New XComment(commentMessage)} 504Return New XNode() {New XComment(commentMessage)} 515Return New XNode() {New XComment(commentMessage)} 520Dim result As XNode() = RewriteMany(loadedElements, resolvedFilePath, originatingSyntax) 535Return New XNode() {New XComment(commentMessage)} 539Return New XNode() {New XComment(commentMessage)}
Microsoft.CodeAnalysis.Workspaces (12)
Shared\Extensions\ISymbolExtensions.cs (12)
297private static XNode[] RewriteInheritdocElements(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XNode node, CancellationToken cancellationToken) 333private static XNode[] RewriteMany(ISymbol symbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XNode[] nodes, CancellationToken cancellationToken) 335var result = new List<XNode>(); 336foreach (var child in nodes) 344private static XNode[]? RewriteInheritdocElement(ISymbol memberSymbol, HashSet<ISymbol>? visitedSymbols, Compilation compilation, XElement element, CancellationToken cancellationToken) 563where TNode : XNode 565XNode copy; 614private static XNode[]? TrySelectNodes(XNode node, string xpath) 621return xpathResult?.Cast<XNode>().ToArray();
netstandard (1)
netstandard.cs (1)
2276[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Xml.Linq.XNode))]
NuGet.Configuration (19)
Settings\Items\AuthorItem.cs (1)
40internal override XNode AsXNode()
Settings\Items\CredentialsItem.cs (1)
215internal override XNode AsXNode()
Settings\Items\FileClientCertItem.cs (1)
140internal override XNode AsXNode()
Settings\Items\OwnersItem.cs (1)
67internal override XNode AsXNode()
Settings\Items\PackageSourceMappingSourceItem.cs (1)
125internal override XNode AsXNode()
Settings\Items\RepositoryItem.cs (1)
104internal override XNode AsXNode()
Settings\Items\StoreClientCertItem.cs (1)
215internal override XNode AsXNode()
Settings\Items\UnknownItem.cs (1)
148internal override XNode AsXNode()
Settings\SettingBase.cs (4)
11internal XNode? Node { get; private set; } 17internal SettingBase(XNode node, SettingsFile origin) 46internal virtual XNode? AsXNode() => Node; 55internal void SetNode(XNode node)
Settings\SettingElement.cs (1)
113internal override XNode AsXNode()
Settings\SettingFactory.cs (1)
14internal static SettingBase Parse(XNode node, SettingsFile origin)
Settings\SettingsGroup.cs (1)
55internal override XNode AsXNode()
Settings\SettingText.cs (1)
84internal override XNode AsXNode()
Utility\XElementUtility.cs (3)
24internal static void AddIndented(XContainer? container, XNode? content) 41internal static void RemoveIndented(XNode? element) 68private static string ComputeOneLevelOfIndentation(XNode node)
NuGet.PackageManagement (4)
Utility\XElementExtensions.cs (4)
73foreach (var sourceChildNode in source.Nodes().ToList()) 133foreach (var targetChildNode in target.Nodes()) 310public static void RemoveIndented(this XNode element) 339private static string ComputeOneLevelOfIndentation(this XNode node)
NuGet.Packaging (1)
PackageCreation\Extensions\XElementExtensions.cs (1)
49foreach (var sourceChildNode in source.Nodes().ToList())
Roslyn.Diagnostics.Analyzers (1)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
143foreach (var node in childNode.Nodes())
System.Private.Xml.Linq (266)
System\Xml\Linq\Extensions.cs (26)
58public static IEnumerable<XElement> Ancestors<T>(this IEnumerable<T?> source) where T : XNode 75public static IEnumerable<XElement> Ancestors<T>(this IEnumerable<T?> source, XName? name) where T : XNode 121/// Returns an <see cref="IEnumerable"/> of <see cref="XNode"/> over the content of a set of nodes 123public static IEnumerable<XNode> Nodes<T>(this IEnumerable<T?> source) where T : XContainer 130private static IEnumerable<XNode> NodesIterator<T>(IEnumerable<T?> source) where T : XContainer 136XNode? n = root.LastNode; 150/// Returns an <see cref="IEnumerable"/> of <see cref="XNode"/> over the descendants of a set of nodes 152public static IEnumerable<XNode> DescendantNodes<T>(this IEnumerable<T?> source) where T : XContainer 205public static IEnumerable<XNode> DescendantNodesAndSelf(this IEnumerable<XElement?> source) 289public static IEnumerable<T> InDocumentOrder<T>(this IEnumerable<T> source) where T : XNode? 296private static IEnumerable<T> DocumentOrderIterator<T>(IEnumerable<T> source) where T : XNode? 302Array.Sort(items, 0, count, XNode.DocumentOrderComparer); 325/// Removes each <see cref="XNode"/> represented in this <see cref="IEnumerable"/> 326/// T which must be a derived from <see cref="XNode"/>. Note that this method uses snapshot semantics 327/// (copies the <see cref="XNode"/>s to an array before deleting each). 329public static void Remove<T>(this IEnumerable<T?> source) where T : XNode 360private static IEnumerable<XElement> GetAncestors<T>(IEnumerable<T?> source, XName? name, bool self) where T : XNode 362foreach (XNode? node in source) 376private static IEnumerable<XNode> GetDescendantNodes<T>(IEnumerable<T?> source, bool self) where T : XContainer 383XNode? n = root; 387XNode? first; 415XNode? n = root; 419if (c != null && c.content is XNode) 421n = ((XNode)c.content).next; 443XNode? n = root.content as XNode;
System\Xml\Linq\XCData.cs (1)
76internal override XNode CloneNode()
System\Xml\Linq\XComment.cs (2)
117internal override XNode CloneNode() 122internal override bool DeepEquals(XNode node)
System\Xml\Linq\XContainer.cs (60)
38XNode? n = (XNode?)other.content; 53public XNode? FirstNode 64public XNode? LastNode 69XNode? n = content as XNode; 80return (XNode)content; 143XNode? n = content as XNode; 253public IEnumerable<XNode> DescendantNodes() 296XNode? n = content as XNode; 349public IEnumerable<XNode> Nodes() 351XNode? n = LastNode; 400XNode? last = content as XNode; 403XNode n = last.next!; 470XNode? n = content as XNode; 509internal void AddNode(XNode n) 518XNode p = this; 526internal void AddNodeSkipNotify(XNode n) 535XNode p = this; 613internal void AppendNode(XNode n) 621internal void AppendNodeSkipNotify(XNode n) 630XNode x = (XNode)content; 646XNode? n = (XNode?)content; 664XNode n = (XNode)content; 675private string CollectText(ref XNode? n) 691XNode? n1 = content as XNode; 692XNode? n2 = e.content as XNode; 714XNode? n = content as XNode; 744internal IEnumerable<XNode> GetDescendantNodes(bool self) 747XNode n = this; 751XNode? first; 773XNode n = this; 777if (c != null && c.content is XNode) 779n = ((XNode)c.content).next!; 795XNode? n = content as XNode; 1013XNode? newNode = null; 1127XNode? newNode = null; 1242internal void RemoveNode(XNode n) 1248XNode p = (XNode)content; 1266XNode? n = content as XNode; 1271XNode next = n.next!; 1282internal virtual void ValidateNode(XNode node, XNode? previous) 1308XNode n = (XNode)content; 1343XNode n = (XNode)content;
System\Xml\Linq\XDocument.cs (10)
873internal override XNode CloneNode() 878internal override bool DeepEquals(XNode node) 889private T? GetFirstNode<T>() where T : XNode 891XNode? n = content as XNode; 904internal override void ValidateNode(XNode node, XNode? previous) 924private void ValidateDocument(XNode? previous, XmlNodeType allowBefore, XmlNodeType allowAfter) 926XNode? n = content as XNode;
System\Xml\Linq\XDocumentType.cs (2)
169internal override XNode CloneNode() 174internal override bool DeepEquals(XNode node)
System\Xml\Linq\XElement.cs (10)
235XNode? n = content as XNode; 326/// <seealso cref="XNode.Ancestors()"/> 331/// <seealso cref="XNode.Ancestors()"/> 348/// <seealso cref="XNode.Ancestors()"/> 424public IEnumerable<XNode> DescendantNodesAndSelf() 1953internal override XNode CloneNode() 1958internal override bool DeepEquals(XNode node) 2123internal override void ValidateNode(XNode node, XNode? previous)
System\Xml\Linq\XLinq.cs (16)
16private XNode? _previous; 19public Inserter(XContainer parent, XNode? anchor) 80XNode? n = content as XNode; 114private void AddNode(XNode n) 123XNode p = _parent; 154private void InsertNode(XNode n) 166XNode last = (XNode)_parent.content; 210XNode n = e; 231n = ((XNode)current.content).next!; 254XNode n = e; 276n = ((XNode)current.content).next!; 586XNode? n = content as XNode; 631private void WriteNode(XNode n)
System\Xml\Linq\XNode.cs (44)
27/// Note that an <see cref="XAttribute"/> is not an <see cref="XNode"/>. 31internal XNode? next; 42public XNode? NextNode 57public XNode? PreviousNode 63XNode n = ((XNode)parent.content!).next!; 64XNode? p = null; 151XNode? p = (XNode)parent.content!; 221public static int CompareDocumentOrder(XNode? n1, XNode? n2) 229XNode p1 = n1; 235XNode p2 = n2; 270XNode n = (XNode)n1.parent!.content!; 307public IEnumerable<XNode> NodesAfterSelf() 309XNode n = this; 324public IEnumerable<XNode> NodesBeforeSelf() 328XNode n = (XNode)parent.content!; 396public bool IsAfter(XNode? node) 407public bool IsBefore(XNode? node) 413/// Creates an <see cref="XNode"/> from an <see cref="XmlReader"/>. 418/// <param name="reader">An <see cref="XmlReader"/> positioned at the node to read into this <see cref="XNode"/>.</param> 419/// <returns>An <see cref="XNode"/> that contains the nodes read from the reader.</returns> 423public static XNode ReadFrom(XmlReader reader) 450/// Creates an <see cref="XNode"/> from an <see cref="XmlReader"/>. 455/// <param name="reader">An <see cref="XmlReader"/> positioned at the node to read into this <see cref="XNode"/>.</param> 457/// <returns>An <see cref="XNode"/> that contains the nodes read from the reader.</returns> 461public static Task<XNode> ReadFromAsync(XmlReader reader, CancellationToken cancellationToken) 466return Task.FromCanceled<XNode>(cancellationToken); 470private static async Task<XNode> ReadFromAsyncInternal(XmlReader reader, CancellationToken cancellationToken) 474XNode ret; 534/// Replaces the content of this <see cref="XNode"/>. 541XNode? p = (XNode)parent.content!; 589/// node. Two <see cref="XNode"/> objects of different types are never equal. Two 599public static bool DeepEquals(XNode? n1, XNode? n2) 623internal abstract XNode CloneNode(); 625internal abstract bool DeepEquals(XNode node); 639XNode n = this; 652XNode n = (XNode)parent.content!;
System\Xml\Linq\XNodeBuilder.cs (1)
214private void AddNode(XNode n)
System\Xml\Linq\XNodeDocumentOrderComparer.cs (10)
16IComparer<XNode?> 31public int Compare(XNode? x, XNode? y) 33return XNode.CompareDocumentOrder(x, y); 54XNode? n1 = x as XNode; 55if (n1 == null && x != null) throw new ArgumentException(SR.Format(SR.Argument_MustBeDerivedFrom, typeof(XNode)), nameof(x)); 56XNode? n2 = y as XNode; 57if (n2 == null && y != null) throw new ArgumentException(SR.Format(SR.Argument_MustBeDerivedFrom, typeof(XNode)), nameof(y));
System\Xml\Linq\XNodeEqualityComparer.cs (19)
16IEqualityComparer<XNode> 26/// node. Two <see cref="XNode"/>s of different types are never equal. Two 37public bool Equals(XNode? x, XNode? y) 39return XNode.DeepEquals(x, y); 43/// Returns a hash code based on an <see cref="XNode"/> objects value. 48/// The <see cref="XNode"/> class's implementation of <see cref="object.GetHashCode"/> 52public int GetHashCode(XNode obj) 65/// node. Two <see cref="XNode"/>s of different types are never equal. Two 78XNode? n1 = x as XNode; 79if (n1 == null && x != null) throw new ArgumentException(SR.Format(SR.Argument_MustBeDerivedFrom, typeof(XNode)), nameof(x)); 80XNode? n2 = y as XNode; 81if (n2 == null && y != null) throw new ArgumentException(SR.Format(SR.Argument_MustBeDerivedFrom, typeof(XNode)), nameof(y)); 91/// The <see cref="XNode"/> class's implementation of <see cref="object.GetHashCode"/> 97XNode? n = obj as XNode; 98if (n == null && obj != null) throw new ArgumentException(SR.Format(SR.Argument_MustBeDerivedFrom, typeof(XNode)), nameof(obj));
System\Xml\Linq\XNodeReader.cs (15)
17private XNode _root; 21internal XNodeReader(XNode node, XmlNameTable? nameTable, ReaderOptions options) 29internal XNodeReader(XNode node, XmlNameTable? nameTable) 930XNode? n = _source as XNode; 1111XNode? n = _source as XNode; 1171XNode? n = _source as XNode; 1186XNode? n = d.content as XNode; 1207XNode? n = e.content as XNode; 1252private bool ReadOverNode(XNode n) 1258XNode? next = n.next;
System\Xml\Linq\XProcessingInstruction.cs (2)
143internal override XNode CloneNode() 148internal override bool DeepEquals(XNode node)
System\Xml\Linq\XStreamingElement.cs (3)
118XmlWriterSettings ws = XNode.GetXmlWriterSettings(options); 146XmlWriterSettings ws = XNode.GetXmlWriterSettings(options); 185XmlWriterSettings ws = XNode.GetXmlWriterSettings(options);
System\Xml\Linq\XText.cs (2)
123internal override XNode CloneNode() 128internal override bool DeepEquals(XNode node)
System\Xml\Schema\XNodeValidator.cs (2)
324XNode? n = e.content as XNode;
System\Xml\XPath\XNodeNavigator.cs (41)
51public XNodeNavigator(XNode node, XmlNameTable? nameTable) 106foreach (XNode node in container.Nodes()) 370foreach (XNode node in c.Nodes()) 404foreach (XNode node in container.Nodes()) 493XNode? currentNode = _source as XNode; 499XNode? next; 500for (XNode node = currentNode; node != null; node = next) 520XNode? currentNode = _source as XNode; 538XNode? currentNode = _source as XNode; 549XNode? next; 550for (XNode node = currentNode; ; node = next) 641XNode? parentNode = _source.GetParent(); 652XNode? currentNode = _source as XNode; 658XNode? previous = null; 659foreach (XNode node in container.Nodes()) 729foreach (XNode node in n.NodesAfterSelf()) 748private static bool IsContent(XContainer c, XNode n) 866public static object Evaluate<T>(XNode node, string expression, IXmlNamespaceResolver? resolver) where T : class 907/// Creates an <see cref="XPathNavigator"/> for a given <see cref="XNode"/> 909/// <param name="node">Extension point <see cref="XNode"/></param> 911public static XPathNavigator CreateNavigator(this XNode node) 917/// Creates an <see cref="XPathNavigator"/> for a given <see cref="XNode"/> 919/// <param name="node">Extension point <see cref="XNode"/></param> 923public static XPathNavigator CreateNavigator(this XNode node, XmlNameTable? nameTable) 940/// <param name="node">Extension point <see cref="XNode"/></param> 944public static object XPathEvaluate(this XNode node, string expression) 952/// <param name="node">Extension point <see cref="XNode"/></param> 958public static object XPathEvaluate(this XNode node, string expression, IXmlNamespaceResolver? resolver) 968/// <param name="node">Extension point <see cref="XNode"/></param> 971public static XElement? XPathSelectElement(this XNode node, string expression) 979/// <param name="node">Extension point <see cref="XNode"/></param> 984public static XElement? XPathSelectElement(this XNode node, string expression, IXmlNamespaceResolver? resolver) 992/// <param name="node">Extension point <see cref="XNode"/></param> 995public static IEnumerable<XElement> XPathSelectElements(this XNode node, string expression) 1003/// <param name="node">Extension point <see cref="XNode"/></param> 1008public static IEnumerable<XElement> XPathSelectElements(this XNode node, string expression, IXmlNamespaceResolver? resolver) 1022foreach (XNode node in parentNode.Nodes())
System.Xml.Linq (1)
System.Xml.Linq.cs (1)
18[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Xml.Linq.XNode))]
System.Xml.XDocument (1)
src\runtime\artifacts\obj\System.Xml.XDocument\Release\net11.0\System.Xml.XDocument.Forwards.cs (1)
17[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Xml.Linq.XNode))]
System.Xml.XPath.XDocument (3)
System\Xml\XPath\XDocumentExtensions.cs (3)
12private readonly XNode _node; 13public XDocumentNavigable(XNode n) 22public static IXPathNavigable ToXPathNavigable(this XNode node)