Skip to content
ConsoleMonster

API Reference

Class

TreeNode

Namespace ConsoleMonster.Widgets
Assembly ConsoleMonster
Modifiers sealed

A node of a Tree: a label (markup), an optional status and children.

Inheritance

  • Object
  • TreeNode

Usage

Explore 30 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 15

Accepted by parameters 15

Constructors

public TreeNode(String label, StatusKind? status = null) #

Creates a node.

Parameters

label System.String requiredposition: 0
The label (markup).
status ConsoleMonster.Styling.StatusKind? = null optionalposition: 1
An optional status marker.

Methods

Add 3 overloads
public TreeNode Add(String label, StatusKind? status = null, String? note = null) #
Returns: TreeNode

Adds a child and returns it.

Parameters

label System.String requiredposition: 0
The label (markup).
status ConsoleMonster.Styling.StatusKind? = null optionalposition: 1
An optional status.
note System.String? = null optionalposition: 2
An optional muted note.

Returns

The new child.

public TreeNode Add(RichText label, StatusKind? status = null, String? note = null) #
Returns: TreeNode

Adds a child with a multicolour label.

Parameters

label ConsoleMonster.Text.RichText requiredposition: 0
The label.
status ConsoleMonster.Styling.StatusKind? = null optionalposition: 1
An optional status.
note System.String? = null optionalposition: 2
An optional muted note.

Returns

The new child.

public TreeNode Add(TreeNode node) #
Returns: TreeNode

Adds an existing node as a child.

Parameters

node ConsoleMonster.Widgets.TreeNode requiredposition: 0
The node.

Returns

This node.

Properties

public String Label { get; set; } #

The label (markup).

public StatusKind? Status { get; set; } #

An optional status marker shown before the label.

public String? Note { get; set; } #

A muted note shown after the label (counts, values), or null.

public TableCell? Value { get; set; } #

A value shown after the label through TreeNode.Presenter (dates, sizes, statuses...), or null.

public ICellPresenter? Presenter { get; set; } #

The presenter for TreeNode.Value, or null for automatic.

public IReadOnlyList<TreeNode> Children { get; } #

The children.

Extension Methods

public static TreeNode WithLabel(TreeNode treeNode, String value) #
Returns: TreeNode

Sets TreeNode.Label: The label (markup).

Parameters

treeNode ConsoleMonster.Widgets.TreeNode requiredposition: 0
The instance.
value System.String requiredposition: 1
The value.

Returns

The same instance.

public static TreeNode WithNote(TreeNode treeNode, String? value) #
Returns: TreeNode

Sets TreeNode.Note: A muted note shown after the label (counts, values), or null.

Parameters

treeNode ConsoleMonster.Widgets.TreeNode requiredposition: 0
The instance.
value System.String? requiredposition: 1
The value.

Returns

The same instance.

public static TreeNode WithPresenter(TreeNode treeNode, ICellPresenter? value) #
Returns: TreeNode

Sets TreeNode.Presenter: The presenter for TreeNode.Value, or null for automatic.

Parameters

treeNode ConsoleMonster.Widgets.TreeNode requiredposition: 0
The instance.
value ConsoleMonster.Presenters.ICellPresenter? requiredposition: 1
The value.

Returns

The same instance.

public static TreeNode WithStatus(TreeNode treeNode, StatusKind? value) #
Returns: TreeNode

Sets TreeNode.Status: An optional status marker shown before the label.

Parameters

treeNode ConsoleMonster.Widgets.TreeNode requiredposition: 0
The instance.
value ConsoleMonster.Styling.StatusKind? requiredposition: 1
The value.

Returns

The same instance.

public static TreeNode WithValue(TreeNode treeNode, TableCell? value) #
Returns: TreeNode

Sets TreeNode.Value: A value shown after the label through TreeNode.Presenter (dates, sizes, statuses...), or null.

Parameters

treeNode ConsoleMonster.Widgets.TreeNode requiredposition: 0
The instance.
value ConsoleMonster.Widgets.TableCell? requiredposition: 1
The value.

Returns

The same instance.