TreeNode
ConsoleMonster.Widgets
A node of a Tree: a label (markup), an optional status and children.
Inheritance
- object
- TreeNode
Usage
Explore 72 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 35
- Method Tree.Add
- Property Tree.CollapsedSummary
- Property Tree.Root
- Extension method TreeNode.AsciiMarker
- Extension method TreeNode.Bare
- Extension method TreeNode.BasicMarker
- Extension method TreeNode.Detail
- Extension method TreeNode.Identity
- Extension method TreeNode.Label
- Extension method TreeNode.Marker
- Extension method TreeNode.MarkerTone
- Extension method TreeNode.MeasureBareLabel
- Extension method TreeNode.Presenter
- Extension method TreeNode.Reference
- Extension method TreeNode.ReferenceSummary
- Extension method TreeNode.Status
- Extension method TreeNode.TruncateLabelInMiddle
- Extension method TreeNode.Value
- Method TreeNode.Add
- Property TreeNode.Children
- Method TreeNodeFluent.AsciiMarker
- Method TreeNodeFluent.Bare
- Method TreeNodeFluent.BasicMarker
- Method TreeNodeFluent.Detail
- Method TreeNodeFluent.Identity
- Method TreeNodeFluent.Label
- Method TreeNodeFluent.Marker
- Method TreeNodeFluent.MarkerTone
- Method TreeNodeFluent.MeasureBareLabel
- Method TreeNodeFluent.Presenter
- Method TreeNodeFluent.Reference
- Method TreeNodeFluent.ReferenceSummary
- Method TreeNodeFluent.Status
- Method TreeNodeFluent.TruncateLabelInMiddle
- Method TreeNodeFluent.Value
Accepted by parameters 37
- Extension method Tree.CollapsedSummaryBy
- Extension method Tree.Root
- Method TreeFluent.CollapsedSummaryBy
- Method TreeFluent.Root
- Method TreeHierarchy.Add``1
- Method TreeHierarchy.Add``1
- Extension method TreeNode.AsciiMarker
- Extension method TreeNode.Bare
- Extension method TreeNode.BasicMarker
- Extension method TreeNode.Detail
- Extension method TreeNode.Identity
- Extension method TreeNode.Label
- Extension method TreeNode.Marker
- Extension method TreeNode.MarkerTone
- Extension method TreeNode.MeasureBareLabel
- Extension method TreeNode.Presenter
- Extension method TreeNode.Reference
- Extension method TreeNode.ReferenceSummary
- Extension method TreeNode.Status
- Extension method TreeNode.TruncateLabelInMiddle
- Extension method TreeNode.Value
- Method TreeNode.Add
- Method TreeNodeFluent.AsciiMarker
- Method TreeNodeFluent.Bare
- Method TreeNodeFluent.BasicMarker
- Method TreeNodeFluent.Detail
- Method TreeNodeFluent.Identity
- Method TreeNodeFluent.Label
- Method TreeNodeFluent.Marker
- Method TreeNodeFluent.MarkerTone
- Method TreeNodeFluent.MeasureBareLabel
- Method TreeNodeFluent.Presenter
- Method TreeNodeFluent.Reference
- Method TreeNodeFluent.ReferenceSummary
- Method TreeNodeFluent.Status
- Method TreeNodeFluent.TruncateLabelInMiddle
- Method TreeNodeFluent.Value
Constructors
public TreeNode(string label, StatusKind? status = null) #Creates a node.
Parameters
- label string
- The label (markup).
- status ConsoleMonster.Styling.StatusKind? = null
- An optional status marker.
Methods
public TreeNode Add(string label, StatusKind? status = null, string? detail = null) #Adds a child and returns it.
Parameters
- label string
- The label (markup).
- status ConsoleMonster.Styling.StatusKind? = null
- An optional status.
- detail string? = null
- An optional muted detail.
public TreeNode Add(RichText label, StatusKind? status = null, string? detail = null) #Adds a child with a multicolour label.
Parameters
- label ConsoleMonster.Text.RichText
- The label.
- status ConsoleMonster.Styling.StatusKind? = null
- An optional status.
- detail string? = null
- An optional muted detail.
public TreeNode Add(TreeNode node) #Adds an existing node as a child.
Parameters
- node ConsoleMonster.Widgets.TreeNode
- The node.
Inherited Methods
Properties
public StatusKind? Status { get; set; } #An optional status marker shown before the label.
public string? Marker { get; set; } #An optional plain text glyph replacing the status glyph, without changing the node's status tone.
public string? BasicMarker { get; set; } #An optional glyph used only in the Basic tier; null retains TreeNode.Marker.
public string? AsciiMarker { get; set; } #The ASCII alternative to TreeNode.Marker; null uses that marker unchanged.
public Tone MarkerTone { get; set; } #An optional theme tone for the marker, independent of status semantics. Null preserves the status or text tone.
public bool Bare { get; set; } #Render a container without a guide and exclude its label from value-column sizing.
public bool MeasureBareLabel { get; set; } #Include a bare node with values when sizing after-label value columns.
public bool TruncateLabelInMiddle { get; set; } #Use a middle ellipsis for this identity label, independently of sibling prose labels.
public string? Detail { get; set; } #A muted detail 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 IDictionary<string, TableCell> Values { get; } #Values keyed by TableColumn.Id for the tree's aligned value columns.
public object? Identity { get; set; } #An optional stable identity for cycle and repeated-node detection; null uses node reference identity.
public TreeReferenceKind Reference { get; set; } #Explicit reference and completeness markers. Cycle, repeat and collapse markers stop traversal.
public string? ReferenceSummary { get; set; } #An optional plain text aggregate or reference detail shown with the marker.
Extension Methods
public static TreeNode AsciiMarker(TreeNode treeNode, string? value) #Sets TreeNode.AsciiMarker: The ASCII alternative to TreeNode.Marker; null uses that marker unchanged.
Parameters
- treeNode ConsoleMonster.Widgets.TreeNode
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
treeNode.AsciiMarker = value; treeNode.AsciiMarker(value);public static TreeNode Bare(TreeNode treeNode, bool value = true) #Sets TreeNode.Bare: Render a container without a guide and exclude its label from value-column sizing.
Parameters
- treeNode ConsoleMonster.Widgets.TreeNode
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
treeNode.Bare = value; treeNode.Bare(value);public static TreeNode BasicMarker(TreeNode treeNode, string? value) #Sets TreeNode.BasicMarker: An optional glyph used only in the Basic tier; null retains TreeNode.Marker.
Parameters
- treeNode ConsoleMonster.Widgets.TreeNode
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
treeNode.BasicMarker = value; treeNode.BasicMarker(value);public static TreeNode Detail(TreeNode treeNode, string? value) #Sets TreeNode.Detail: A muted detail shown after the label (counts, values), or null.
Parameters
- treeNode ConsoleMonster.Widgets.TreeNode
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
treeNode.Detail = value; treeNode.Detail(value);public static TreeNode Identity(TreeNode treeNode, object? value) #Sets TreeNode.Identity: An optional stable identity for cycle and repeated-node detection; null uses node reference identity.
Parameters
- treeNode ConsoleMonster.Widgets.TreeNode
- The instance.
- value object?
- The value.
Examples
// C# initializer or property // C# fluent
treeNode.Identity = value; treeNode.Identity(value);public static TreeNode Label(TreeNode treeNode, string value) #Sets TreeNode.Label: The label (markup).
Parameters
- treeNode ConsoleMonster.Widgets.TreeNode
- The instance.
- value string
- The value.
Examples
// C# initializer or property // C# fluent
treeNode.Label = value; treeNode.Label(value);public static TreeNode Marker(TreeNode treeNode, string? value) #Sets TreeNode.Marker: An optional plain text glyph replacing the status glyph, without changing the node's status tone.
Parameters
- treeNode ConsoleMonster.Widgets.TreeNode
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
treeNode.Marker = value; treeNode.Marker(value);public static TreeNode MarkerTone(TreeNode treeNode, Tone value) #Sets TreeNode.MarkerTone: An optional theme tone for the marker, independent of status semantics. Null preserves the status or text tone.
Parameters
- treeNode ConsoleMonster.Widgets.TreeNode
- The instance.
- value ConsoleMonster.Tone
- The value.
Examples
// C# initializer or property // C# fluent
treeNode.MarkerTone = value; treeNode.MarkerTone(value);public static TreeNode MeasureBareLabel(TreeNode treeNode, bool value = true) #Sets TreeNode.MeasureBareLabel: Include a bare node with values when sizing after-label value columns.
Parameters
- treeNode ConsoleMonster.Widgets.TreeNode
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
treeNode.MeasureBareLabel = value; treeNode.MeasureBareLabel(value);public static TreeNode Presenter(TreeNode treeNode, ICellPresenter? value) #Sets TreeNode.Presenter: The presenter for TreeNode.Value, or null for automatic.
Parameters
- treeNode ConsoleMonster.Widgets.TreeNode
- The instance.
- value ConsoleMonster.Presenters.ICellPresenter?
- The value.
Examples
// C# initializer or property // C# fluent
treeNode.Presenter = value; treeNode.Presenter(value);public static TreeNode Reference(TreeNode treeNode, TreeReferenceKind value) #Sets TreeNode.Reference: Explicit reference and completeness markers. Cycle, repeat and collapse markers stop traversal.
Parameters
- treeNode ConsoleMonster.Widgets.TreeNode
- The instance.
- value ConsoleMonster.Widgets.TreeReferenceKind
- The value.
Examples
// C# initializer or property // C# fluent
treeNode.Reference = value; treeNode.Reference(value);public static TreeNode ReferenceSummary(TreeNode treeNode, string? value) #Sets TreeNode.ReferenceSummary: An optional plain text aggregate or reference detail shown with the marker.
Parameters
- treeNode ConsoleMonster.Widgets.TreeNode
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
treeNode.ReferenceSummary = value; treeNode.ReferenceSummary(value);public static TreeNode Status(TreeNode treeNode, StatusKind? value) #Sets TreeNode.Status: An optional status marker shown before the label.
Parameters
- treeNode ConsoleMonster.Widgets.TreeNode
- The instance.
- value ConsoleMonster.Styling.StatusKind?
- The value.
Examples
// C# initializer or property // C# fluent
treeNode.Status = value; treeNode.Status(value);public static TreeNode TruncateLabelInMiddle(TreeNode treeNode, bool value = true) #Sets TreeNode.TruncateLabelInMiddle: Use a middle ellipsis for this identity label, independently of sibling prose labels.
Parameters
- treeNode ConsoleMonster.Widgets.TreeNode
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
treeNode.TruncateLabelInMiddle = value; treeNode.TruncateLabelInMiddle(value);public static TreeNode Value(TreeNode treeNode, TableCell? value) #Sets TreeNode.Value: A value shown after the label through TreeNode.Presenter (dates, sizes, statuses...), or null.
Parameters
- treeNode ConsoleMonster.Widgets.TreeNode
- The instance.
- value ConsoleMonster.Widgets.TableCell?
- The value.
Examples
// C# initializer or property // C# fluent
treeNode.Value = value; treeNode.Value(value);