Skip to content
ConsoleMonster

API Reference

Class

Prioritized

Namespace ConsoleMonster.Layout
Assembly ConsoleMonster
Implements
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, Int32 priority, Int32 minimumHeight = 1, Int32 minimumWidth = 20) #

Wraps a widget.

Parameters

child ConsoleMonster.Layout.IWidget requiredposition: 0
The widget.
priority System.Int32 requiredposition: 1
Higher shows first in reduced layouts.
minimumHeight System.Int32 = 1 optionalposition: 2
The rows it needs to be useful (default 1).
minimumWidth System.Int32 = 20 optionalposition: 3
The cells it needs to be useful (default 20).

Methods

public Size Measure(Constraints constraints, RenderContext context) #
Returns: Size

Returns the size the widget wants within the constraints.

Parameters

constraints ConsoleMonster.Layout.Constraints requiredposition: 0
The space offered.
context ConsoleMonster.Canvas.RenderContext requiredposition: 1
Profile, theme and glyphs.

Returns

The desired size, never larger than the constraints.

public Void Render(Region region, RenderContext context) #
Returns: Void

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

Parameters

region ConsoleMonster.Canvas.Region requiredposition: 0
The target region.
context ConsoleMonster.Canvas.RenderContext requiredposition: 1
Profile, theme and glyphs.

Properties

public IWidget Child { get; } #

The widget.

public Int32 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.