API Reference
Tree
A hierarchy with guide lines (├──, └──, │ on Full/Basic; |-- on Ascii). Guides use the border colour so the labels carry the attention. Long labels are truncated with an ellipsis.
Inheritance
- Object
- Tree
Usage
Explore 15 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 9
- Method Ui.Tree
- Method ConsoleView.BuildTree
- Method InspectorTree.Build
- Extension method Tree.WithPresentation
- Extension method Tree.WithRoot
- Extension method Tree.WithShowRoot
- Method TreeFluent.WithPresentation
- Method TreeFluent.WithRoot
- Method TreeFluent.WithShowRoot
Accepted by parameters 6
- Extension method Tree.WithPresentation
- Extension method Tree.WithRoot
- Extension method Tree.WithShowRoot
- Method TreeFluent.WithPresentation
- Method TreeFluent.WithRoot
- Method TreeFluent.WithShowRoot
Constructors
public Tree(String? rootLabel = null) #Creates a tree.
Parameters
- rootLabel System.String? = null
- The root label (markup), or null to show only the children as top-level nodes.
Methods
public TreeNode Add(String label, StatusKind? status = null, String? note = null) #TreeNodeAdds a top-level node.
Parameters
- label System.String
- The label (markup).
- status ConsoleMonster.Styling.StatusKind? = null
- An optional status.
- note System.String? = null
- An optional muted note.
Returns
The new node.
public TreeNode Add(RichText label, StatusKind? status = null, String? note = null) #TreeNodeAdds a top-level node with a multicolour label.
Parameters
- label ConsoleMonster.Text.RichText
- The label.
- status ConsoleMonster.Styling.StatusKind? = null
- An optional status.
- note System.String? = null
- An optional muted note.
Returns
The new node.
public Size Measure(Constraints constraints, RenderContext context) #SizeReturns the size the widget wants within the constraints.
Parameters
- constraints ConsoleMonster.Layout.Constraints
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
Returns
The desired size, never larger than the constraints.
public Void Render(Region region, RenderContext context) #VoidRenders into a region. The region may be smaller or larger than the measured size.
Parameters
- region ConsoleMonster.Canvas.Region
- The target region.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
public PresentationOptions Presentation { get; set; } #Culture, clock and time zone for node values.
Extension Methods
public static Tree WithPresentation(Tree tree, PresentationOptions value) #TreeSets Tree.Presentation: Culture, clock and time zone for node values.
Parameters
- tree ConsoleMonster.Widgets.Tree
- The instance.
- value ConsoleMonster.Presenters.PresentationOptions
- The value.
Returns
The same instance.
public static Tree WithPresentation(Tree tree, Action<PresentationOptions> configure) #TreeConfigures Tree.Presentation in place (creating it when not set): Culture, clock and time zone for node values.
Parameters
- tree ConsoleMonster.Widgets.Tree
- The instance.
- configure System.Action<ConsoleMonster.Presenters.PresentationOptions>
- Configures the value.
Returns
The same instance.
public static Tree WithRoot(Tree tree, Action<TreeNode> configure) #TreeConfigures Tree.Root in place: The root node.
Parameters
- tree ConsoleMonster.Widgets.Tree
- The instance.
- configure System.Action<ConsoleMonster.Widgets.TreeNode>
- Configures the value.
Returns
The same instance.
public static Tree WithShowRoot(Tree tree, Boolean value = true) #TreeSets Tree.ShowRoot: Whether the root label is shown.
Parameters
- tree ConsoleMonster.Widgets.Tree
- The instance.
- value System.Boolean = true
- The value (default true).
Returns
The same instance.