public sealed class Node
Represents a single node in an undo history. A node contains an undo record, as well as parent/child relationships with adjacent nodes.

Properties

Children

#
public IEnumerable<Node> Children { get; }
Enumerate over all existing child nodes, starting with the youngest one.

Depth

#
public int Depth { get; }
Gets the number of steps between this node and the Root.

IsRoot

#
public bool IsRoot { get; }
Gets whether this node is a root node.

Parent

#
public Node Parent { get; }
Gets the parent node, if any.

ParentIfNotRoot

#
public Node ParentIfNotRoot { get; }
Gets the parent node, provided the parent isn't a root node.

PrimaryChild

#
public Node PrimaryChild { get; }
Gets the primary child, if defined.

Record

#
public Record Record { get; }
Gets the undo record contained in this node.

SecondaryChildren

#
public IEnumerable<Node> SecondaryChildren { get; }
Enumerate over all secondary children.

Methods

AllDescendants

#
public Node[] AllDescendants()
Find all descendants of this node.

IndexOf

#
public int IndexOf(Node node)
Gets the index of a specific node within the child list.
node (Node)

IndexOf

#
public int IndexOf(Record record)
Gets the index of a specific record within the child list.
record (Record)

IsDescendantNode

#
public bool IsDescendantNode(Node node)
Gets whether the specified node is a descendant of this node.
node (Node)

IsPrimaryNode

#
public bool IsPrimaryNode(Node node)
Gets whether the specified node is a primary child node of this node.
node (Node)

IsSecondaryNode

#
public bool IsSecondaryNode(Node node)
Gets whether the specified node is a secondary child node of this node.
node (Node)

ToString

#
public override string ToString()
Object.ToString