Skip to content
ConsoleMonster
Class

PathSet

ConsoleMonster.Widgets

Namespace
ConsoleMonster.Widgets
Assembly
ConsoleMonster
Implements
IWidget
Modifiers
sealed

Several labelled chains from one origin, wrapping at arrows and optionally marking shared hop identities.

Inheritance

  • object
  • PathSet

Usage

Explore 25 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 13

Accepted by parameters 12

Constructors

public PathSet(PathHop origin) #

Creates a set of paths from one origin.

Parameters

origin ConsoleMonster.Widgets.PathHop required
The common origin, automatically prepended to each added chain.

Methods

public PathSet Add(params PathHop[] hops) #

Adds the hops after the origin in one chain, preserving repeated hops and input order.

Parameters

hops ConsoleMonster.Widgets.PathHop[] required
The hops after the common origin.

Returns

PathSet This set.
public Size Measure(Constraints constraints, RenderContext context) #

Returns the size the widget wants within the constraints.

Parameters

constraints ConsoleMonster.Layout.Constraints required
The space offered.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.

Returns

Size The desired size, never larger than the constraints.
public void Render(Region region, RenderContext context) #

Renders into a region. The region may be smaller or larger than the measured size.

Parameters

region ConsoleMonster.Canvas.Region required
The target region.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.

Properties

public PathHop Origin { get; } #

The common origin.

public string? Title { get; set; } #

An optional markup title.

public bool HighlightSharedHops { get; set; } #

Mark hops present in more than one distinct chain with an asterisk and a legend.

public bool CompactBranches { get; set; } #

Show the origin once and use compact branching chains with four-cell hanging continuations.

public int MaxPaths { get; set; } #

The most chains rendered (default 10; zero shows all); omitted chains are counted.

public int MaxHops { get; set; } #

The maximum accepted hops per chain, excluding the origin (default 100).

public int PathCount { get; } #

The number of supplied chains.

Extension Methods

CompactBranches 2 overloads
public static PathSet CompactBranches(PathSet pathSet, bool value) #

Sets PathSet.CompactBranches: Show the origin once and use compact branching chains with four-cell hanging continuations.

Parameters

pathSet ConsoleMonster.Widgets.PathSet required
The instance.
value bool required
The value.

Returns

PathSet The same instance.

Examples

// C# initializer or property       // C# fluent
pathSet.CompactBranches = value;    pathSet.CompactBranches(value);
public static PathSet CompactBranches(PathSet pathSet) #

Sets PathSet.CompactBranches to true.

Parameters

pathSet ConsoleMonster.Widgets.PathSet required
The instance to configure.

Returns

PathSet The same instance.
HighlightSharedHops 2 overloads
public static PathSet HighlightSharedHops(PathSet pathSet, bool value) #

Sets PathSet.HighlightSharedHops: Mark hops present in more than one distinct chain with an asterisk and a legend.

Parameters

pathSet ConsoleMonster.Widgets.PathSet required
The instance.
value bool required
The value.

Returns

PathSet The same instance.

Examples

// C# initializer or property           // C# fluent
pathSet.HighlightSharedHops = value;    pathSet.HighlightSharedHops(value);
public static PathSet HighlightSharedHops(PathSet pathSet) #

Sets PathSet.HighlightSharedHops to true.

Parameters

pathSet ConsoleMonster.Widgets.PathSet required
The instance to configure.

Returns

PathSet The same instance.
public static PathSet MaxHops(PathSet pathSet, int value) #

Sets PathSet.MaxHops: The maximum accepted hops per chain, excluding the origin (default 100).

Parameters

pathSet ConsoleMonster.Widgets.PathSet required
The instance.
value int required
The value.

Returns

PathSet The same instance.

Examples

// C# initializer or property    // C# fluent
pathSet.MaxHops = value;         pathSet.MaxHops(value);
public static PathSet MaxPaths(PathSet pathSet, int value) #

Sets PathSet.MaxPaths: The most chains rendered (default 10; zero shows all); omitted chains are counted.

Parameters

pathSet ConsoleMonster.Widgets.PathSet required
The instance.
value int required
The value.

Returns

PathSet The same instance.

Examples

// C# initializer or property    // C# fluent
pathSet.MaxPaths = value;        pathSet.MaxPaths(value);
public static PathSet Origin(PathSet pathSet, Action<PathHop> configure) #

Configures PathSet.Origin in place: The common origin.

Parameters

pathSet ConsoleMonster.Widgets.PathSet required
The instance.
configure System.Action<ConsoleMonster.Widgets.PathHop> required
Configures the value.

Returns

PathSet The same instance.
public static PathSet Title(PathSet pathSet, string? value) #

Sets PathSet.Title: An optional markup title.

Parameters

pathSet ConsoleMonster.Widgets.PathSet required
The instance.
value string? required
The value.

Returns

PathSet The same instance.

Examples

// C# initializer or property    // C# fluent
pathSet.Title = value;           pathSet.Title(value);