Skip to content
ConsoleMonster
Class

Legend

ConsoleMonster.Widgets

Namespace
ConsoleMonster.Widgets
Assembly
ConsoleMonster
Implements
IWidget
Modifiers
sealed

A rich legend laid out in an aligned row-major grid with three-cell gaps.

Inheritance

  • object
  • Legend

Usage

Explore 8 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 4

Accepted by parameters 4

Constructors

public Legend(params string[] entries) #

Creates a legend from markup entries. Empty entries are omitted.

Parameters

entries string[] required

Methods

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 IList<string> Entries { get; } #

Markup entries in display order.

Extension Methods

AddEntries 2 overloads
public static Legend AddEntries(Legend legend, params string[] items) #

Adds items to Legend.Entries: Markup entries in display order.

Parameters

legend ConsoleMonster.Widgets.Legend required
The instance.
items string[] required
The items, in order.

Returns

Legend The same instance.
public static Legend AddEntries(Legend legend, IEnumerable<string> items) #

Adds items to Legend.Entries: Markup entries in display order.

Parameters

legend ConsoleMonster.Widgets.Legend required
The instance.
items System.Collections.Generic.IEnumerable<string> required
The items, in order.

Returns

Legend The same instance.
public static Legend AddEntry(Legend legend, string item) #

Adds an item to Legend.Entries: Markup entries in display order.

Parameters

legend ConsoleMonster.Widgets.Legend required
The instance.
item string required
The item.

Returns

Legend The same instance.