Skip to content
ConsoleMonster

API Reference

Class

WatchView

Namespace ConsoleMonster.Widgets
Assembly ConsoleMonster
Implements
Modifiers sealed

The view of a command run again and again (ConsoleWatch, Watch-Console): a heading with the interval, the title, the run number and the time of the last run, then the latest output. With WatchView.Differences, each value (a table cell, a word or number) that changed since the previous run is shown bold on a soft surface tone, over its own colours, until a run leaves it unchanged; without colour a marker before it (↑, ↓ or *) says so. Live operation: update (Payload = the new content widget, Value = the run number, Text = a status such as an error message, or null).

Inheritance

Usage

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

Constructors

public WatchView(String name = "watch") #

Creates a watch view.

Parameters

name System.String = "watch" optionalposition: 0
The live name (default watch).

Methods

public override Void Apply(LiveEvent liveEvent) #
Returns: Void

Applies an event to the widget's state.

Parameters

liveEvent ConsoleMonster.Live.LiveEvent requiredposition: 0
The event.
public override 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 override 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.
public WatchView Update(IWidget content, Int32 iteration, String? status = null, DateTimeOffset? time = null) #
Returns: WatchView

Shows the output of a new run; the previous output becomes the base for WatchView.Differences.

Parameters

content ConsoleMonster.Layout.IWidget requiredposition: 0
The new content.
iteration System.Int32 requiredposition: 1
The run number.
status System.String? = null optionalposition: 2
A status (an error message), or null.
time System.DateTimeOffset? = null optionalposition: 3
The time of the run, or null for now.

Returns

This instance.

Properties

public String? Title { get; set; } #

What is being watched, shown in the heading (markup), or null.

public TimeSpan Interval { get; set; } #

The time between runs, shown in the heading.

public Boolean Differences { get; set; } #

Whether values that changed since the previous run are highlighted (bold on a soft surface; a marker without colour).

public Int32 Iteration { get; private set; } #

The number of the latest run (1 for the first).

public String? Status { get; private set; } #

A status shown after the heading (an error of the last run), or null.

Extension Methods

public static WatchView WithDifferences(WatchView watchView, Boolean value = true) #
Returns: WatchView

Sets WatchView.Differences: Whether values that changed since the previous run are highlighted (bold on a soft surface; a marker without colour).

Parameters

watchView ConsoleMonster.Widgets.WatchView requiredposition: 0
The instance.
value System.Boolean = true optionalposition: 1
The value (default true).

Returns

The same instance.

public static WatchView WithInterval(WatchView watchView, TimeSpan value) #
Returns: WatchView

Sets WatchView.Interval: The time between runs, shown in the heading.

Parameters

watchView ConsoleMonster.Widgets.WatchView requiredposition: 0
The instance.
value System.TimeSpan requiredposition: 1
The value.

Returns

The same instance.

public static WatchView WithTitle(WatchView watchView, String? value) #
Returns: WatchView

Sets WatchView.Title: What is being watched, shown in the heading (markup), or null.

Parameters

watchView ConsoleMonster.Widgets.WatchView requiredposition: 0
The instance.
value System.String? requiredposition: 1
The value.

Returns

The same instance.