TreeWalker Class
https://dom.spec.whatwg.org/#interface-treewalker
public sealed class TreeWalkerProperties
| Name | Description |
|---|---|
| CurrentNode | Gets or sets the node the walker is currently positioned at. |
| Filter | Gets the filter used to accept, reject or skip nodes, or null when there is none. |
| Root | Gets the root node of the traversal. |
| WhatToShow | Gets the bit mask of the node types the walker presents. |
CurrentNode
TreeWalker.csGets or sets the node the walker is currently positioned at.
public Node CurrentNode { get; set; }Filter
TreeWalker.csGets the filter used to accept, reject or skip nodes, or null when there is none.
public INodeFilter? Filter { get; }Root
TreeWalker.csGets the root node of the traversal.
public Node Root { get; }WhatToShow
TreeWalker.csGets the bit mask of the node types the walker presents.
public uint WhatToShow { get; }Methods
| Name | Description |
|---|---|
| FirstChild() | Moves to the first visible child of the current node and returns it, or null when there is none. |
| LastChild() | Moves to the last visible child of the current node and returns it, or null when there is none. |
| NextNode() | https://dom.spec.whatwg.org/#dom-treewalker-nextnode |
| NextSibling() | Moves to the next visible sibling of the current node and returns it, or null when there is none. |
| ParentNode() | https://dom.spec.whatwg.org/#dom-treewalker-parentnode |
| PreviousNode() | https://dom.spec.whatwg.org/#dom-treewalker-previousnode |
| PreviousSibling() | Moves to the previous visible sibling of the current node and returns it, or null when there is none. |
FirstChild()
TreeWalker.csMoves to the first visible child of the current node and returns it, or null when there is none.
public Node? FirstChild()LastChild()
TreeWalker.csMoves to the last visible child of the current node and returns it, or null when there is none.
public Node? LastChild()NextNode()
TreeWalker.cshttps://dom.spec.whatwg.org/#dom-treewalker-nextnode
public Node? NextNode()NextSibling()
TreeWalker.csMoves to the next visible sibling of the current node and returns it, or null when there is none.
public Node? NextSibling()ParentNode()
TreeWalker.cshttps://dom.spec.whatwg.org/#dom-treewalker-parentnode
public Node? ParentNode()PreviousNode()
TreeWalker.cshttps://dom.spec.whatwg.org/#dom-treewalker-previousnode
public Node? PreviousNode()PreviousSibling()
TreeWalker.csMoves to the previous visible sibling of the current node and returns it, or null when there is none.
public Node? PreviousSibling()