Skip to content
ConsoleMonster
Class

TreeFluent

ConsoleMonster.Widgets

Namespace
ConsoleMonster.Widgets
Assembly
ConsoleMonster
Modifiers
static

The fluent methods of Tree, generated from its public properties: A property-named method sets a property and a singular-named method adds to a collection, both returning the same instance.

Inheritance

  • object
  • TreeFluent

Methods

public static Tree CollapsedSummaryBy(Tree tree, Func<TreeNode, string>? value) #

Sets Tree.CollapsedSummary: Produces a plain text aggregate for explicitly collapsed nodes; never enumerates descendants itself.

Parameters

tree ConsoleMonster.Widgets.Tree required
The instance.
value System.Func<ConsoleMonster.Widgets.TreeNode, string>? required
The callback.

Returns

Tree The same instance.

Examples

// C# initializer or property                                            // C# fluent
new global::ConsoleMonster.Widgets.Tree { CollapsedSummary = value };    Ui.Tree().CollapsedSummaryBy(value);
public static Tree CompactGuides(Tree tree, bool value = true) #

Sets Tree.CompactGuides: Use three-cell guides rather than the original four-cell guides.

Parameters

tree ConsoleMonster.Widgets.Tree required
The instance.
value bool = true optional
The value; true when omitted.

Returns

Tree The same instance.

Examples

// C# initializer or property                                         // C# fluent
new global::ConsoleMonster.Widgets.Tree { CompactGuides = value };    Ui.Tree().CompactGuides(value);
public static Tree DetectRepeatedNodes(Tree tree, bool value = true) #

Sets Tree.DetectRepeatedNodes: Mark identities seen on earlier branches as shown above instead of expanding them again.

Parameters

tree ConsoleMonster.Widgets.Tree required
The instance.
value bool = true optional
The value; true when omitted.

Returns

Tree The same instance.

Examples

// C# initializer or property                                               // C# fluent
new global::ConsoleMonster.Widgets.Tree { DetectRepeatedNodes = value };    Ui.Tree().DetectRepeatedNodes(value);
Presentation 2 overloads
public static Tree Presentation(Tree tree, PresentationOptions value) #

Sets Tree.Presentation: Culture, clock and time zone for node values.

Parameters

tree ConsoleMonster.Widgets.Tree required
The instance.
value ConsoleMonster.Presenters.PresentationOptions required
The value.

Returns

Tree The same instance.

Examples

// C# initializer or property                                        // C# fluent
new global::ConsoleMonster.Widgets.Tree { Presentation = value };    Ui.Tree().Presentation(value);
public static Tree Presentation(Tree tree, Action<PresentationOptions> configure) #

Configures Tree.Presentation in place (creating it when not set): Culture, clock and time zone for node values.

Parameters

tree ConsoleMonster.Widgets.Tree required
The instance.
configure System.Action<ConsoleMonster.Presenters.PresentationOptions> required
Configures the value.

Returns

Tree The same instance.
public static Tree Root(Tree tree, Action<TreeNode> configure) #

Configures Tree.Root in place: The root node.

Parameters

tree ConsoleMonster.Widgets.Tree required
The instance.
configure System.Action<ConsoleMonster.Widgets.TreeNode> required
Configures the value.

Returns

Tree The same instance.
public static Tree ShowRoot(Tree tree, bool value = true) #

Sets Tree.ShowRoot: Whether the root label is shown.

Parameters

tree ConsoleMonster.Widgets.Tree required
The instance.
value bool = true optional
The value; true when omitted.

Returns

Tree The same instance.

Examples

// C# initializer or property                                    // C# fluent
new global::ConsoleMonster.Widgets.Tree { ShowRoot = value };    Ui.Tree().ShowRoot(value);
public static Tree ShowValueHeaders(Tree tree, bool value = true) #

Sets Tree.ShowValueHeaders: Show headings above aligned value columns (default true).

Parameters

tree ConsoleMonster.Widgets.Tree required
The instance.
value bool = true optional
The value; true when omitted.

Returns

Tree The same instance.

Examples

// C# initializer or property                                            // C# fluent
new global::ConsoleMonster.Widgets.Tree { ShowValueHeaders = value };    Ui.Tree().ShowValueHeaders(value);
public static Tree Title(Tree tree, string? value) #

Sets Tree.Title: The root title (markup); null hides the root while preserving its children.

Parameters

tree ConsoleMonster.Widgets.Tree required
The instance.
value string? required
The value.

Returns

Tree The same instance.

Examples

// C# initializer or property                                 // C# fluent
new global::ConsoleMonster.Widgets.Tree { Title = value };    Ui.Tree().Title(value);
public static Tree TruncateLabelsInMiddle(Tree tree, bool value = true) #

Sets Tree.TruncateLabelsInMiddle: Use a middle ellipsis for shortened identity labels, preserving both ends (default false).

Parameters

tree ConsoleMonster.Widgets.Tree required
The instance.
value bool = true optional
The value; true when omitted.

Returns

Tree The same instance.

Examples

// C# initializer or property                                                  // C# fluent
new global::ConsoleMonster.Widgets.Tree { TruncateLabelsInMiddle = value };    Ui.Tree().TruncateLabelsInMiddle(value);
public static Tree TruncateNotesInMiddle(Tree tree, bool value = true) #

Sets Tree.TruncateNotesInMiddle: Use the rendering context's middle ellipsis for shortened notes and value notes, preserving both ends (default false). Labels keep priority; wrapped notes continue to wrap.

Parameters

tree ConsoleMonster.Widgets.Tree required
The instance.
value bool = true optional
The value; true when omitted.

Returns

Tree The same instance.

Examples

// C# initializer or property                                                 // C# fluent
new global::ConsoleMonster.Widgets.Tree { TruncateNotesInMiddle = value };    Ui.Tree().TruncateNotesInMiddle(value);
public static Tree ValueColumn(Tree tree, TableColumn item) #

Adds an item to Tree.ValueColumns: Aligned value columns, keyed by TableColumn.Id in TreeNode.Values. Default alignment is right. Wide layouts reserve at least 40% for labels and shrink value columns before dropping them. Below 120 cells fitting detail precedes value notes. Lower priorities drop first; labels always receive space first. With columns the tree uses single-line labels, regardless of Tree.WrapLabels.

Parameters

tree ConsoleMonster.Widgets.Tree required
The instance.
item ConsoleMonster.Widgets.TableColumn required
The item.

Returns

Tree The same instance.
public static Tree ValueColumns(Tree tree, IEnumerable<TableColumn> items) #

Adds items to Tree.ValueColumns: Aligned value columns, keyed by TableColumn.Id in TreeNode.Values. Default alignment is right. Wide layouts reserve at least 40% for labels and shrink value columns before dropping them. Below 120 cells fitting detail precedes value notes. Lower priorities drop first; labels always receive space first. With columns the tree uses single-line labels, regardless of Tree.WrapLabels.

Parameters

tree ConsoleMonster.Widgets.Tree required
The instance.
items System.Collections.Generic.IEnumerable<ConsoleMonster.Widgets.TableColumn> required
The items, in order.

Returns

Tree The same instance.
public static Tree ValuePlacement(Tree tree, TreeValuePlacement value) #

Sets Tree.ValuePlacement: Where value columns begin. Default views use AfterLabel.

Parameters

tree ConsoleMonster.Widgets.Tree required
The instance.
value ConsoleMonster.Widgets.TreeValuePlacement required
The value.

Returns

Tree The same instance.

Examples

// C# initializer or property                                          // C# fluent
new global::ConsoleMonster.Widgets.Tree { ValuePlacement = value };    Ui.Tree().ValuePlacement(value);
public static Tree WrapLabels(Tree tree, bool value = true) #

Sets Tree.WrapLabels: Wrap labels, values and notes with a hanging indent instead of shortening them (default false).

Parameters

tree ConsoleMonster.Widgets.Tree required
The instance.
value bool = true optional
The value; true when omitted.

Returns

Tree The same instance.

Examples

// C# initializer or property                                      // C# fluent
new global::ConsoleMonster.Widgets.Tree { WrapLabels = value };    Ui.Tree().WrapLabels(value);