API Reference
Spinner
A one-line activity indicator for work without a known total: ⠹ Resolving DNS records zone 4 of ? 3.2s. While running it animates with the frame counter (braille in Full, | / - \ in Basic and ASCII); once finished it shows the status marker in the status tone and the final duration. Live operations: label (Text), detail (Text), state (State, optional Text as the detail), start (restarts the clock and returns to running).
Inheritance
- LiveWidget
- Spinner
Usage
Explore 24 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 12
- Extension method Spinner.WithDetail
- Extension method Spinner.WithFinished
- Extension method Spinner.WithLabel
- Extension method Spinner.WithShowElapsed
- Extension method Spinner.WithStarted
- Extension method Spinner.WithStatus
- Method SpinnerFluent.WithDetail
- Method SpinnerFluent.WithFinished
- Method SpinnerFluent.WithLabel
- Method SpinnerFluent.WithShowElapsed
- Method SpinnerFluent.WithStarted
- Method SpinnerFluent.WithStatus
Accepted by parameters 12
- Extension method Spinner.WithDetail
- Extension method Spinner.WithFinished
- Extension method Spinner.WithLabel
- Extension method Spinner.WithShowElapsed
- Extension method Spinner.WithStarted
- Extension method Spinner.WithStatus
- Method SpinnerFluent.WithDetail
- Method SpinnerFluent.WithFinished
- Method SpinnerFluent.WithLabel
- Method SpinnerFluent.WithShowElapsed
- Method SpinnerFluent.WithStarted
- Method SpinnerFluent.WithStatus
Constructors
public Spinner(String label = "", String name = "spinner") #Creates a spinner.
Parameters
- label System.String = ""
- The label (markup).
- name System.String = "spinner"
- The live name (default spinner).
Methods
public override Void Apply(LiveEvent liveEvent) #VoidApplies an event to the widget's state.
Parameters
- liveEvent ConsoleMonster.Live.LiveEvent
- The event.
public override String? Describe(LiveEvent liveEvent) #String?Returns a line describing the event for line-based outputs (Stream/Plain), or null when the event is not worth a line (for example a single counter increment). Called after ILiveTarget.Apply.
Parameters
- liveEvent ConsoleMonster.Live.LiveEvent
- The event that was applied.
Returns
A plain line or null.
public String? GetSummaryLine() #String?Returns the current status, or null to omit this target from the heartbeat.
Returns
The plain-text status line.
public SpinnerHandle Handle(ILiveDispatcher dispatcher) #SpinnerHandleReturns a handle that updates this spinner through a dispatcher.
Parameters
- dispatcher ConsoleMonster.Live.ILiveDispatcher
- The dispatcher.
Returns
The handle.
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 Boolean TryGetTaskbarProgress(out TaskbarState state, out Double fraction) #BooleanThe widget's contribution, if any.
Parameters
- state ConsoleMonster.Output.TaskbarState
- The state (Normal, Indeterminate, Error or Paused).
- fraction System.Double
- The fraction done (0 to 1), or NaN when unknown.
Returns
False when the widget has nothing to report.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
public String? Detail { get; set; } #Muted detail shown after the label, for example the current item.
public StatusKind Status { get; set; } #The status; anything other than Running or Pending replaces the animation with the status marker.
public Boolean ShowElapsed { get; set; } #Whether the elapsed time is shown on the right (default true).
public TimeSpan? Started { get; set; } #When the current run started on the session clock, or null for "when the session started". Set by the start operation and by the first running state event.
public TimeSpan? Finished { get; set; } #When the spinner finished on the session clock, or null while running.
Inherited Properties
Extension Methods
public static Spinner WithDetail(Spinner spinner, String? value) #SpinnerSets Spinner.Detail: Muted detail shown after the label, for example the current item.
Parameters
- spinner ConsoleMonster.Widgets.Spinner
- The instance.
- value System.String?
- The value.
Returns
The same instance.
public static Spinner WithFinished(Spinner spinner, TimeSpan? value) #SpinnerSets Spinner.Finished: When the spinner finished on the session clock, or null while running.
Parameters
- spinner ConsoleMonster.Widgets.Spinner
- The instance.
- value System.TimeSpan?
- The value.
Returns
The same instance.
public static Spinner WithLabel(Spinner spinner, String value) #SpinnerSets Spinner.Label: The label (markup).
Parameters
- spinner ConsoleMonster.Widgets.Spinner
- The instance.
- value System.String
- The value.
Returns
The same instance.
public static Spinner WithShowElapsed(Spinner spinner, Boolean value = true) #SpinnerSets Spinner.ShowElapsed: Whether the elapsed time is shown on the right (default true).
Parameters
- spinner ConsoleMonster.Widgets.Spinner
- The instance.
- value System.Boolean = true
- The value (default true).
Returns
The same instance.
public static Spinner WithStarted(Spinner spinner, TimeSpan? value) #SpinnerSets Spinner.Started: When the current run started on the session clock, or null for "when the session started". Set by the start operation and by the first running state event.
Parameters
- spinner ConsoleMonster.Widgets.Spinner
- The instance.
- value System.TimeSpan?
- The value.
Returns
The same instance.
public static Spinner WithStatus(Spinner spinner, StatusKind value) #SpinnerSets Spinner.Status: The status; anything other than Running or Pending replaces the animation with the status marker.
Parameters
- spinner ConsoleMonster.Widgets.Spinner
- The instance.
- value ConsoleMonster.Styling.StatusKind
- The value.
Returns
The same instance.