WatchView
ConsoleMonster.Widgets
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
- LiveWidget
- WatchView
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.
Returned or exposed by 7
- Extension method WatchView.Differences
- Extension method WatchView.PollInterval
- Extension method WatchView.Title
- Method WatchView.Update
- Method WatchViewFluent.Differences
- Method WatchViewFluent.PollInterval
- Method WatchViewFluent.Title
Accepted by parameters 6
- Extension method WatchView.Differences
- Extension method WatchView.PollInterval
- Extension method WatchView.Title
- Method WatchViewFluent.Differences
- Method WatchViewFluent.PollInterval
- Method WatchViewFluent.Title
Constructors
public WatchView(string widgetId = "watch") #Creates a watch view.
Parameters
- widgetId string = "watch"
- The live name (default watch).
Methods
public override void Apply(LiveEvent liveEvent) #Applies an event to the widget's state.
Parameters
- liveEvent ConsoleMonster.Live.LiveEvent
- The event.
public override Size Measure(Constraints constraints, RenderContext context) #Returns the size the widget wants within the constraints.
Parameters
- constraints ConsoleMonster.Layout.Constraints
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
public override 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
- The target region.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
public WatchView Update(IWidget content, int iteration, string? status = null, DateTimeOffset? time = null) #Shows the output of a new run; the previous output becomes the base for WatchView.Differences.
Parameters
- content ConsoleMonster.Layout.IWidget
- The new content.
- iteration int
- The run number.
- status string? = null
- A status (an error message), or null.
- time System.DateTimeOffset? = null
- The time of the run, or null for now.
Inherited Methods
public virtual string? Describe(LiveEvent liveEvent) #Parameters
- liveEvent LiveEvent
Returns
string?Properties
public string? Title { get; set; } #What is being watched, shown in the heading (markup), or null.
public TimeSpan PollInterval { get; set; } #The time between runs, shown in the heading.
public bool Differences { get; set; } #Whether values that changed since the previous run are highlighted (bold on a soft surface; a marker without colour).
public int 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.
Inherited Properties
Extension Methods
public static WatchView Differences(WatchView watchView, bool value = true) #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
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.WatchView { Differences = value }; watchView.Differences(value);public static WatchView PollInterval(WatchView watchView, TimeSpan value) #Sets WatchView.PollInterval: The time between runs, shown in the heading.
Parameters
- watchView ConsoleMonster.Widgets.WatchView
- The instance.
- value System.TimeSpan
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.WatchView { PollInterval = value }; watchView.PollInterval(value);public static WatchView Title(WatchView watchView, string? value) #Sets WatchView.Title: What is being watched, shown in the heading (markup), or null.
Parameters
- watchView ConsoleMonster.Widgets.WatchView
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.WatchView { Title = value }; watchView.Title(value);