Status

Represents a status display.

Represents a status display.

Constructors

public Status(IAnsiConsole console)

Initializes a new instance of the Status class.

Parameters:

console (IAnsiConsole)
The console.

Properties

AutoRefresh : bool

Gets or sets a value indicating whether or not status should auto refresh. Defaults to true.

Spinner : Spinner

Gets or sets the spinner.

Methods

public void Start(string status, Action<StatusContext> action)

Starts a new status display.

Parameters:

status (string)
The status to display.
action (Action<StatusContext>)
The action to execute.
public T Start<T>(string status, Func<StatusContext, T> func)

Starts a new status display.

Parameters:

status (string)
The status to display.
func (Func<StatusContext, T>)
The action to execute.

Returns:

The result.

public Task StartAsync(string status, Func<StatusContext, Task> action)

Starts a new status display.

Parameters:

status (string)
The status to display.
action (Func<StatusContext, Task>)
The action to execute.

Returns:

A Task representing the asynchronous operation.

public Task<T> StartAsync<T>(string status, Func<StatusContext, Task<T>> func)

Starts a new status display and returns a result.

Parameters:

status (string)
The status to display.
func (Func<StatusContext, Task<T>>)
The action to execute.

Returns:

A Task representing the asynchronous operation.

Extension Methods

Status AutoRefresh(this Status status, bool enabled)

Sets whether or not auto refresh is enabled. If disabled, you will manually have to refresh the progress.

Returns:

The same instance so that multiple calls can be chained.

Status Spinner(this Status status, Spinner spinner)

Sets the spinner.

Returns:

The same instance so that multiple calls can be chained.