Tree Class

Representation of non-circular tree data. Each node added to the tree may only be present in it a single time, in order to facilitate cycle detection.
public sealed class Tree : Renderable, IRenderable, IHasTreeNodes
Namespace
Spectre.Console
Base Types

Constructors

Tree(IRenderable)
Initializes a new instance of the Tree class.
Tree(string)
Initializes a new instance of the Tree class.

Properties

bool Expanded
Gets or sets a value indicating whether or not the tree is expanded or not.
TreeGuide Guide
Gets or sets the tree guide lines.
List<TreeNode> Nodes
Gets the tree's child nodes.
Style Style
Gets or sets the tree style.

Methods

protected virtual Measurement Measure(RenderOptions, int)
Measures the renderable object.
protected override IEnumerable<Segment> Render(RenderOptions, int)
Renders the object.

Extension Methods

TreeNode AddNode<Tree>(IRenderable)
Adds a tree node.
TreeNode AddNode<Tree>(string)
Adds a tree node.
TreeNode AddNode<Tree>(TreeNode)
Adds a tree node.
void AddNodes<Tree>(IEnumerable<IRenderable>)
Add multiple tree nodes.
void AddNodes<Tree>(IEnumerable<string>)
Add multiple tree nodes.
void AddNodes<Tree>(IEnumerable<TreeNode>)
Add multiple tree nodes.
void AddNodes<Tree>(IRenderable[])
Add multiple tree nodes.
void AddNodes<Tree>(string[])
Add multiple tree nodes.
void AddNodes<Tree>(TreeNode[])
Add multiple tree nodes.
IEnumerable<Segment> GetSegments(IAnsiConsole)
Gets the segments for a renderable using the specified console.
Tree Guide(TreeGuide)
Sets the tree guide line appearance.
Tree Style(Style)
Sets the tree style.