Skip to content
ConsoleMonster
Class

LiveEvent

ConsoleMonster.Live

Namespace
ConsoleMonster.Live
Assembly
ConsoleMonster
Modifiers
sealed

One update for a live widget, addressed by the widget's name. Every live change travels as a LiveEvent, so updates from any thread can be queued, coalesced, recorded as JSON lines and replayed without reflection.

Inheritance

  • object
  • LiveEvent

Usage

Explore 65 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 2

Accepted by parameters 63

Constructors

public LiveEvent(string widgetId, string operation, string? key = null, string? text = null, string? status = null, double value = 0, double total = 0, long time = 0, bool isMarkup = false) #

Creates an event.

Parameters

widgetId string required
The name of the target widget.
operation string required
The operation, defined by the target (for example advance, add, write).
key string? = null optional
The item key inside the target (lane, phase, row), when the operation needs one.
text string? = null optional
Free text (log line, detail, label).
status string? = null optional
A state word (pass, fail, running, info, warn...).
value double = 0 optional
A numeric value (increment, sample, current value).
total double = 0 optional
A second numeric value (maximum, total, duration).
time long = 0 optional
Milliseconds since the session started; the session stamps it when 0.
isMarkup bool = false optional
Whether text is markup (rich text) rather than literal text.

Methods

public override string ToString() #

Returns a string that represents the current object.

Returns

string A string that represents the current object.
public LiveEvent WithTime(long time) #

Returns a copy stamped with a time.

Parameters

time long required
Milliseconds since the session started.

Returns

LiveEvent The stamped event.

Properties

public bool IsMarkup { get; } #

Whether LiveEvent.Text is markup (rich text, for example from New-ConsoleText) rather than literal text. Targets that show text literally (lane labels and detail, log lines) render it with its styles when set.

public string WidgetId { get; } #

The name of the target widget.

public string Operation { get; } #

The operation.

public string? Key { get; } #

The item key inside the target.

public string? Text { get; } #

Free text.

public string? Status { get; } #

A state word.

public double Value { get; } #

A numeric value.

public double Total { get; } #

A second numeric value.

public long Time { get; } #

Milliseconds since the session started.

public object? Payload { get; set; } #

An in-process object for the target (a replacement widget for a RegionWidget, row values for a LiveTable, or an IWidget to append through a log target), or null. It is not recorded: a replayed recording sees only the text fields.