Table of Contents

Class SpinnerTicker

Namespace
ItTiger.TigerCli.Tui.Controls
Assembly
ItTiger.TigerCli.dll
A TuiTicker that cycles through a fixed sequence of string frames, wrapping back to the first frame after the last. Suitable for a loading spinner or any small cyclic indicator. Frames come either from a predefined SpinnerFrameSet (the default being a four-step braille spinner) or from a caller-supplied custom sequence. Generic by design — it owns frames and timing only and carries no knowledge of any particular control. The frame strings are raw content: any presentation (brackets, styling, title prefixing) is decided by the overlay or title that renders them.
public sealed class SpinnerTicker : TuiTicker
Inheritance
SpinnerTicker
Inherited Members

Constructors

SpinnerTicker(SpinnerFrameSet, TimeSpan?, bool)

Creates a spinner from a predefined frameSet.
public SpinnerTicker(SpinnerFrameSet frameSet = SpinnerFrameSet.Default, TimeSpan? interval = null, bool active = true)

Parameters

frameSet SpinnerFrameSet
Which predefined frame sequence to cycle; defaults to Default.
interval TimeSpan?
Frame period; defaults to DefaultInterval (500 ms).
active bool
Whether the spinner starts active (indefinite) or idle (scoped).

SpinnerTicker(TimeSpan, IReadOnlyList<string>, bool)

Creates a spinner from a caller-supplied custom frames sequence.
public SpinnerTicker(TimeSpan interval, IReadOnlyList<string> frames, bool active = true)

Parameters

interval TimeSpan
Frame period; must be positive.
frames IReadOnlyList<string>
Custom frame sequence; must be non-empty and contain no null/empty frame.
active bool
Whether the spinner starts active (indefinite) or idle (scoped).

Properties

CurrentContent

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

Property Value

string

DefaultInterval

The default frame period (500 ms) used when no interval is supplied.
public static TimeSpan DefaultInterval { 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 override bool IsActive { get; }

Property Value

bool

Methods

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 override bool AdvanceFrame()

Returns

bool

Frames(SpinnerFrameSet)

The raw frame strings backing frameSet, in cycle order.
public static IReadOnlyList<string> Frames(SpinnerFrameSet frameSet)

Parameters

frameSet SpinnerFrameSet

Returns

IReadOnlyList<string>

Start()

Begins animating (scoped use). Indefinite spinners are already active.
public void Start()

Stop()

Stops animating; the overlay renders nothing until Start() is called again.
public void Stop()