TreeNodeTNode Class

Abstract tree node supporting two-way (parent to child and child to parent) hierarchical relationships. Can enumerate with a variety of traversal strategies; defaults to pre-order.

Definition

Namespace: MobileTrack.Common.Models.TreeViews
Assembly: MobileTrack.Common (in MobileTrack.Common.dll) Version: 0.7+1dadc87dcf0a0f837e19a3ce2deb7c1cd85375d1
public abstract class TreeNode<TNode> : IEnumerable<TNode>, 
	IEnumerable
where TNode : TreeNode<TNode>
Inheritance
Object    TreeNodeTNode
Derived
Implements
IEnumerableTNode, IEnumerable

Type Parameters

TNode
The specific node type.

Constructors

TreeNodeTNode Default constructor

Properties

Children The children of this node.
Depth Max depth of the branch containing this node; for the root, this is the tree's max depth
IsLeaf Whether this node is a leaf, meaning it doesn't have any children.
IsRoot Whether this is the root node of the tree.
Level How many levels deep the item is in the tree.
NextSibling The next sibling of the item, if applicable. Necessary for enumeration methods.
OrderIndex The index of this node in the hierarchy.
Parent The parent of the item (if applicable).
PreviousSibling The previous sibling of the item, if applicable. Necessary for enumeration methods.
Root Root node of the Tree.
This Gets the current Node.

Methods

AppendChildren Adds children to this node.
GetEnumeratorReturns an enumerator that iterates through the collection.
IsAncestorOf Determines if this node is an ancestor of the given node
IsDescendantOf Determines if this node is a descendant of the given node
IsSiblingOf Determines if this node is a sibling of the given node
OnAddCanProceed Whether we can proceed with adding children to this node.
SelectAncestorsDownward Select all ancestral nodes to this node as a path downward starting from the root. This query will also return the final object, the node calling this method.
SelectAncestorsUpward Select all ancestral nodes in the path from this node's parent to the root
SelectDescendants Select all descendants of this node
SelectLeaves Select all leaves beneath this node (or node itself if leaf)
SelectPathDownward Select this node and all ancestral nodes in the path downward starting from the root. This query will not include the node itself, only the path.
SelectPathUpward Select this node and all ancestral nodes in the path up to the root
SelectSiblings Select all siblings of this node
SelectSiblingsAfter Select siblings after this node
SelectSiblingsBefore Select siblings before this node
SetChildErrorsOnAttachment Under what grounds to set errors on child elements when they're being attached to this node.
SetChildrenSiblingReferences Set the sibling references for the children of this node, so they are aware of each other's existence. This is required for enumerator functions.

Fields

ChildrenList All the children of this node. (If any)

Explicit Interface Implementations

IEnumerableGetEnumeratorReturns an enumerator that iterates through a collection.

See Also