Skip to content
ConsoleMonster
Class

TreeHierarchyOptions

ConsoleMonster.Widgets

Namespace
ConsoleMonster.Widgets
Assembly
ConsoleMonster
Modifiers
sealed
Attributes
Fluent

Limits for TreeHierarchy.Add: how deep, how wide and how large a tree built from objects may grow.

Inheritance

  • object
  • TreeHierarchyOptions

Usage

Explore 33 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.

Accepted by parameters 17

Constructors

public TreeHierarchyOptions() #

Properties

public int Depth { get; set; } #

How many levels of children are followed below each top-level item (default 5; 0 shows only the items).

public int MaxItems { get; set; } #

The most children listed per node, and top-level items listed, before a "+N more" note (default 25; 0 or less lists all).

public int MaxNodes { get; set; } #

The most nodes the whole hierarchy may add (default 5000; 0 or less for no limit); beyond it a "node limit reached" note ends the walk.

public Func<object, object>? Identity { get; set; } #
Fluent("IdentityBy")

The identity of an item for cycle detection (for example the object a host wrapper wraps), or null to use the item itself. An item that is already on the path from the top is shown once more with a "(cycle)" note and not followed.

public bool DetectRepeatedNodes { get; set; } #

Suppress identities already shown on another branch, using explicit repeat markers (default false).

public IEqualityComparer<object>? IdentityComparer { get; set; } #

An optional identity comparer. Null preserves reference identity, including for custom identities.

public Func<object, string>? CollapsedSummary { get; set; } #
Fluent("CollapsedSummaryBy")

Produces a plain text aggregate when descendants are omitted at the depth limit.

public Func<object, bool>? IsIncomplete { get; set; } #
Fluent("IncompleteWhen")

Reports incomplete source data independently of configured depth or size limits.

Extension Methods

public static TreeHierarchyOptions CollapsedSummaryBy(TreeHierarchyOptions treeHierarchyOptions, Func<object, string>? value) #

Sets TreeHierarchyOptions.CollapsedSummary: Produces a plain text aggregate when descendants are omitted at the depth limit.

Parameters

treeHierarchyOptions ConsoleMonster.Widgets.TreeHierarchyOptions required
The instance.
value System.Func<object, string>? required
The callback.

Returns

TreeHierarchyOptions The same instance.

Examples

// C# initializer or property                                                            // C# fluent
new global::ConsoleMonster.Widgets.TreeHierarchyOptions { CollapsedSummary = value };    treeHierarchyOptions.CollapsedSummaryBy(value);
public static TreeHierarchyOptions Depth(TreeHierarchyOptions treeHierarchyOptions, int value) #

Sets TreeHierarchyOptions.Depth: How many levels of children are followed below each top-level item (default 5; 0 shows only the items).

Parameters

treeHierarchyOptions ConsoleMonster.Widgets.TreeHierarchyOptions required
The instance.
value int required
The value.

Returns

TreeHierarchyOptions The same instance.

Examples

// C# initializer or property                                                 // C# fluent
new global::ConsoleMonster.Widgets.TreeHierarchyOptions { Depth = value };    treeHierarchyOptions.Depth(value);
public static TreeHierarchyOptions DetectRepeatedNodes(TreeHierarchyOptions treeHierarchyOptions, bool value = true) #

Sets TreeHierarchyOptions.DetectRepeatedNodes: Suppress identities already shown on another branch, using explicit repeat markers (default false).

Parameters

treeHierarchyOptions ConsoleMonster.Widgets.TreeHierarchyOptions required
The instance.
value bool = true optional
The value; true when omitted.

Returns

TreeHierarchyOptions The same instance.

Examples

// C# initializer or property                                                               // C# fluent
new global::ConsoleMonster.Widgets.TreeHierarchyOptions { DetectRepeatedNodes = value };    treeHierarchyOptions.DetectRepeatedNodes(value);
public static TreeHierarchyOptions IdentityBy(TreeHierarchyOptions treeHierarchyOptions, Func<object, object>? value) #

Sets TreeHierarchyOptions.Identity: The identity of an item for cycle detection (for example the object a host wrapper wraps), or null to use the item itself. An item that is already on the path from the top is shown once more with a "(cycle)" note and not followed.

Parameters

treeHierarchyOptions ConsoleMonster.Widgets.TreeHierarchyOptions required
The instance.
value System.Func<object, object>? required
The callback.

Returns

TreeHierarchyOptions The same instance.

Examples

// C# initializer or property                                                    // C# fluent
new global::ConsoleMonster.Widgets.TreeHierarchyOptions { Identity = value };    treeHierarchyOptions.IdentityBy(value);
public static TreeHierarchyOptions IdentityComparer(TreeHierarchyOptions treeHierarchyOptions, IEqualityComparer<object>? value) #

Sets TreeHierarchyOptions.IdentityComparer: An optional identity comparer. Null preserves reference identity, including for custom identities.

Parameters

treeHierarchyOptions ConsoleMonster.Widgets.TreeHierarchyOptions required
The instance.
value System.Collections.Generic.IEqualityComparer<object>? required
The value.

Returns

TreeHierarchyOptions The same instance.

Examples

// C# initializer or property                                                            // C# fluent
new global::ConsoleMonster.Widgets.TreeHierarchyOptions { IdentityComparer = value };    treeHierarchyOptions.IdentityComparer(value);
public static TreeHierarchyOptions IncompleteWhen(TreeHierarchyOptions treeHierarchyOptions, Func<object, bool>? value) #

Sets TreeHierarchyOptions.IsIncomplete: Reports incomplete source data independently of configured depth or size limits.

Parameters

treeHierarchyOptions ConsoleMonster.Widgets.TreeHierarchyOptions required
The instance.
value System.Func<object, bool>? required
The callback.

Returns

TreeHierarchyOptions The same instance.

Examples

// C# initializer or property                                                        // C# fluent
new global::ConsoleMonster.Widgets.TreeHierarchyOptions { IsIncomplete = value };    treeHierarchyOptions.IncompleteWhen(value);
public static TreeHierarchyOptions MaxItems(TreeHierarchyOptions treeHierarchyOptions, int value) #

Sets TreeHierarchyOptions.MaxItems: The most children listed per node, and top-level items listed, before a "+N more" note (default 25; 0 or less lists all).

Parameters

treeHierarchyOptions ConsoleMonster.Widgets.TreeHierarchyOptions required
The instance.
value int required
The value.

Returns

TreeHierarchyOptions The same instance.

Examples

// C# initializer or property                                                    // C# fluent
new global::ConsoleMonster.Widgets.TreeHierarchyOptions { MaxItems = value };    treeHierarchyOptions.MaxItems(value);
public static TreeHierarchyOptions MaxNodes(TreeHierarchyOptions treeHierarchyOptions, int value) #

Sets TreeHierarchyOptions.MaxNodes: The most nodes the whole hierarchy may add (default 5000; 0 or less for no limit); beyond it a "node limit reached" note ends the walk.

Parameters

treeHierarchyOptions ConsoleMonster.Widgets.TreeHierarchyOptions required
The instance.
value int required
The value.

Returns

TreeHierarchyOptions The same instance.

Examples

// C# initializer or property                                                    // C# fluent
new global::ConsoleMonster.Widgets.TreeHierarchyOptions { MaxNodes = value };    treeHierarchyOptions.MaxNodes(value);