Table of Contents

Class TuiTicker

Namespace
ItTiger.TigerCli.Tui.Abstractions
Assembly
ItTiger.TigerCli.dll
A time-driven source of overlay content for semi-interactive dialogs. A ticker owns a frame/content that changes at a fixed Interval while it is IsActive. The hosting modal loop advances every active ticker once per iteration via Advance(DateTime); when a ticker reports its visible output changed, the loop re-renders. Tickers carry no rendering or layout logic — they only expose CurrentContent, which the dialog's overlay renderer reads.
public abstract class TuiTicker
Inheritance
TuiTicker
Derived
Inherited Members

Remarks

The baseline for the interval is captured on the first Advance(DateTime) call, so a ticker never "jumps" a frame at modal entry. Time is supplied by the caller (the shell's ITuiClock), which keeps animation deterministic under a manual test clock. An indefinite ticker keeps IsActive true for the modal's life; a scoped ticker toggles it to animate only while an operation runs.

Constructors

TuiTicker(TimeSpan)

Creates a ticker with the specified frame interval.
protected TuiTicker(TimeSpan interval)

Parameters

interval TimeSpan
The positive period between frame advances.

Properties

CurrentContent

The current visible content (e.g. a spinner frame or a formatted clock), read by the overlay renderer.
public abstract string CurrentContent { get; }

Property Value

string

Interval

The period between frame advances.
public TimeSpan Interval { get; }

Property Value

TimeSpan

IsActive

Whether the ticker currently animates. Indefinite tickers stay active for the modal's life; scoped tickers return false while idle so their overlay renders nothing.
public virtual bool IsActive { get; }

Property Value

bool

Methods

Advance(DateTime)

Advances the ticker to nowUtc. Returns true when the visible output changed and the modal should re-render. The first call only captures the interval baseline (no change); an inactive ticker never advances and resets its baseline so a later restart begins a fresh interval rather than flipping immediately.
public bool Advance(DateTime nowUtc)

Parameters

nowUtc DateTime

Returns

bool

AdvanceFrame()

Advances exactly one frame. Returns true when the visible output changed (so even a content-only ticker such as a clock can report it needs a redraw each interval).
protected abstract bool AdvanceFrame()

Returns

bool