API Reference
WatchView
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.WithDifferences
- Extension method WatchView.WithInterval
- Extension method WatchView.WithTitle
- Method WatchView.Update
- Method WatchViewFluent.WithDifferences
- Method WatchViewFluent.WithInterval
- Method WatchViewFluent.WithTitle
Accepted by parameters 6
- Extension method WatchView.WithDifferences
- Extension method WatchView.WithInterval
- Extension method WatchView.WithTitle
- Method WatchViewFluent.WithDifferences
- Method WatchViewFluent.WithInterval
- Method WatchViewFluent.WithTitle
Constructors
public WatchView(String name = "watch") #Creates a watch view.
Parameters
- name System.String = "watch"
- The live name (default watch).
Methods
public override Void Apply(LiveEvent liveEvent) #VoidApplies an event to the widget's state.
Parameters
- liveEvent ConsoleMonster.Live.LiveEvent
- The event.
public override Size Measure(Constraints constraints, RenderContext context) #SizeReturns the size the widget wants within the constraints.
Parameters
- constraints ConsoleMonster.Layout.Constraints
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
Returns
The desired size, never larger than the constraints.
public override Void Render(Region region, RenderContext context) #VoidRenders 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, Int32 iteration, String? status = null, DateTimeOffset? time = null) #WatchViewShows the output of a new run; the previous output becomes the base for WatchView.Differences.
Parameters
- content ConsoleMonster.Layout.IWidget
- The new content.
- iteration System.Int32
- The run number.
- status System.String? = null
- A status (an error message), or null.
- time System.DateTimeOffset? = null
- The time of the run, or null for now.
Returns
This instance.
Inherited Methods
public virtual String? Describe(LiveEvent liveEvent) #String?Parameters
- liveEvent LiveEvent
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
public String? Title { get; set; } #What is being watched, shown in the heading (markup), or null.
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.
Inherited Properties
Extension Methods
public static WatchView WithDifferences(WatchView watchView, Boolean value = true) #WatchViewSets 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 System.Boolean = true
- The value (default true).
Returns
The same instance.
public static WatchView WithInterval(WatchView watchView, TimeSpan value) #WatchViewSets WatchView.Interval: The time between runs, shown in the heading.
Parameters
- watchView ConsoleMonster.Widgets.WatchView
- The instance.
- value System.TimeSpan
- The value.
Returns
The same instance.
public static WatchView WithTitle(WatchView watchView, String? value) #WatchViewSets WatchView.Title: What is being watched, shown in the heading (markup), or null.
Parameters
- watchView ConsoleMonster.Widgets.WatchView
- The instance.
- value System.String?
- The value.
Returns
The same instance.