Node<TNode> Class
Definition
Abstract base class for nodes in a tree.
Type Parameters
Name | Description |
---|---|
TNode | Self generic node parameter. |
Constructors
Name | Description |
---|---|
Initialises a new instance of the Node<TNode> class. | |
Initialises a new instance of the Node<TNode> class with the specified children. |
Properties
Name | Description |
---|---|
Lazily enumerates over the ancestors of this node, i.e. the Parent, grandparent, great-grandparent and so on up to the root node. | |
The children of this node. | |
Enumerates all descendents of this node in depth first pre-order. | |
Returns | |
Returns | |
Returns | |
Returns | |
Returns | |
Returns | |
Returns | |
Returns | |
The index of this node in the Parent or -1 if this node has no Parent. | |
| |
| |
The Messages associated with this node. | |
The next sibling, i.e. the child from the same Parent at the next positional index. Returns | |
Lazily enumerates over the next siblings, i.e. the children from the same Parent at subsequent positional indices in ascending index order. | |
The parent of this node. | |
The previous sibling, i.e. the child from the same Parent at the previous positional index. Returns | |
Lazily enumerates over the previous siblings, i.e. the children from the same Parent at precedent positional indices in descending index order. | |
The root node, i.e. the highest parent above this node. Returns this node if it is the root, i.e. it has no parents. | |
The position of the node in the source code. | |
Lazily enumerates over this node and its Ancestors, i.e. this node, the Parent, grandparent, great-grandparent and so on up to the root node. | |
Enumerates this node then all descendents of this node in depth first pre-order. | |
Returns | |
Returns | |
Returns | |
Returns | |
Lazily enumerates over this node and its descendents returning only those that have Messages with Level Error. | |
Lazily enumerates over this node and its descendents returning only those that have Messages with Level Info. | |
Lazily enumerates over this node and its descendents returning only those that have Messages. | |
Lazily enumerates over this node and its descendents returning only those that have Messages with Level Warning. | |
Lazily enumerates over this node then the next siblings, i.e. the children from the same Parent at subsequent positional indices in ascending index order. | |
Lazily enumerates over this node then the previous siblings, i.e. the children from the same Parent at precedent positional indices in descending index order. | |
Methods
Name | Description |
---|---|
Adds a Message with Level Error and the specified text to this node. | |
Adds a Message with Level Error and the specified text to this node. | |
Adds a Message with Level Info and the specified text to this node. | |
Adds a Message with Level Info and the specified text to this node. | |
Adds a Message to this node. | |
Adds a Message with the specified Level and Text to this node. | |
Adds a Message with the specified Level, Code and Text to this node. | |
Adds the specified node as the NextSibling to this node. Existing next siblings will be moved on index to the right to accommodate. | |
Adds the specified node as the PreviousSibling to this node. This and any next siblings will be moved one index to the right to accommodate. | |
Adds a Message with Level Warning and the specified text to this node. | |
Adds a Message with Level Warning and the specified text to this node. | |
Lazily enumerates over this node and its Ancestors, returning only ancestors of the specified type. | |
Moves this node to a new parent. | |
Removes this node from its Parent. | |
Removes the NextSibling from Parent if it exists. | |
Removes the PreviousSibling from Parent if it exists. | |
Removes this node from it's parent and puts another node in its place. | |
Lazily enumerates over this node and then the specified enumeration of nodes. | |
Lazily enumerates over the Ancestors of this node, returning only ancestors of the specified type. | |
Returns a string that represents the current node. Defaults to the name of the type of the node. |