Skip to content
ConsoleMonster
Class

Prioritized

ConsoleMonster.Layout

Namespace
ConsoleMonster.Layout
Assembly
ConsoleMonster
Modifiers
sealed

Declares a widget's priority and minimum size for reduced layouts. It renders its child unchanged; when a dashboard is too small for its full layout it shows the highest-priority Prioritized widgets that fit, in order.

Inheritance

  • object
  • Prioritized

Constructors

public Prioritized(IWidget child, int priority, int minimumHeight = 1, int minimumWidth = 20) #

Wraps a widget.

Parameters

child ConsoleMonster.Layout.IWidget required
The widget.
priority int required
Higher shows first in reduced layouts.
minimumHeight int = 1 optional
The rows it needs to be useful (default 1).
minimumWidth int = 20 optional
The cells it needs to be useful (default 20).

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 IWidget Child { get; } #

The widget.

public int Priority { get; } #

Higher shows first in reduced layouts.

public Size MinimumSize { get; } #

The size it needs to be useful.

public IReadOnlyList<IWidget> Children { get; } #

The child widgets in layout order.