Skip to content
ConsoleMonster

API Reference

Class

ConsoleWatch

Namespace ConsoleMonster.Live
Assembly ConsoleMonster
Modifiers static

Runs a function again and again and shows its latest result as a live view (the way watch does): the heading counts the runs, changed cells can be highlighted, a failed run shows its error and the watch goes on. On a terminal that is not interactive (redirected output, CI) every run is printed instead. Watch-Console is the PowerShell face.

Inheritance

  • Object
  • ConsoleWatch

Methods

public static Int32 Run(Func<Int32, IWidget> produce, WatchOptions? options = null, CancellationToken cancellationToken = default) #
Returns: Int32

Watches until cancelled or WatchOptions.Count runs have finished.

Parameters

produce System.Func<System.Int32, ConsoleMonster.Layout.IWidget> requiredposition: 0
Builds the view of one run, given its number (1 for the first). It runs on the calling thread.
options ConsoleMonster.Live.WatchOptions? = null optionalposition: 1
Options, or null for the defaults.
cancellationToken System.Threading.CancellationToken = default optionalposition: 2
Ends the watch; the final frame stays.

Returns

The number of runs.