Class TreeNode<T>
Defnines methods for TreeNode
Inheritance
System.Object
TreeNode<T>
Namespace: PnP.Framework.Diagnostics.Tree
Assembly: PnP.Framework.dll
Syntax
public class TreeNode<T> : object, ITreeNode<T>, ITreeNode where T : new()
Type Parameters
T
Generic type |
Constructors
TreeNode()
Defalt Constructor
Declaration
public TreeNode()
TreeNode(T)
Constructor
Declaration
public TreeNode(T Value)
Parameters
T
Value
Generic type value |
TreeNode(T, TreeNode<T>)
Constructor
Declaration
public TreeNode(T Value, TreeNode<T> Parent)
Parameters
T
Value
Generic type value |
TreeNode<T>
Parent
TreeNode |
Properties
Ancestors
Gets list of ancestors
Declaration
public IEnumerable<ITreeNode> Ancestors { get; }
Property Value
IEnumerable<ITreeNode>
|
Implements
ChildNodes
Gets list of Child nodes
Declaration
public IEnumerable<ITreeNode> ChildNodes { get; }
Property Value
IEnumerable<ITreeNode>
|
Implements
Children
Gets children node
Declaration
public TreeNodeList<T> Children { get; }
Property Value
TreeNodeList<T>
|
Implements
Depth
Gets depth of a tree
Declaration
public int Depth { get; }
Property Value
System.Int32
|
Implements
Descendants
Gets list of descendants
Declaration
public IEnumerable<ITreeNode> Descendants { get; }
Property Value
IEnumerable<ITreeNode>
|
Implements
Height
Gets height of a tree
Declaration
public int Height { get; }
Property Value
System.Int32
|
Implements
Parent
Gets or sets parent of a node
Declaration
public ITreeNode<T> Parent { get; set; }
Property Value
ITreeNode<T>
|
Implements
ParentNode
Gets parent node
Declaration
public ITreeNode ParentNode { get; }
Property Value
ITreeNode
|
Implements
Root
Subtree
Gets sub tree nodes
Declaration
public IEnumerable<ITreeNode> Subtree { get; }
Property Value
IEnumerable<ITreeNode>
|
Value
Gets or sets node value
Declaration
public T Value { get; set; }
Property Value
T
|
Implements
Methods
SetParent(ITreeNode<T>, Boolean)
Sets parent node
Declaration
public void SetParent(ITreeNode<T> node, bool updateChildNodes = true)
Parameters
ITreeNode<T>
node
Tree node to set as parent |
System.Boolean
updateChildNodes
Based on boolean value updates child nodes |
Implements
ToString()
Returns comma seperated Depth, height and number of children of a tree as a string
Declaration
public override string ToString()
Returns
System.String
Returns comma seperated Depth, height and number of children of a tree as a string |