Skip to content
ConsoleMonster
Class

TerminalScope

ConsoleMonster.Live

Namespace
ConsoleMonster.Live
Assembly
ConsoleMonster
Modifiers
static

Ambient progress reporting that flows with the asynchronous execution context.

Inheritance

  • object
  • TerminalScope

Methods

public static void Advance(double amount = 1) #

Advances the ambient item.

Parameters

amount double = 1 optional
Increment, default one.
public static IDisposable Begin(ILiveDispatcher dispatcher, string target, string? key = null) #

Begins a scope. Dispose it in the same execution context to restore the previous scope.

Parameters

dispatcher ConsoleMonster.Live.ILiveDispatcher required
Event destination.
target string required
Target name.
key string? = null optional
Optional item key.

Returns

IDisposable The scope lifetime.
public static void Log(string text, string level = "info") #

Writes to the ambient dispatcher's log target.

Parameters

text string required
Log line.
level string = "info" optional
Log level.
public static void Report(string text) #

Reports detail to the ambient item.

Parameters

text string required
Detail text.
public static void SetState(string state, string? text = null) #

Changes the ambient item's state.

Parameters

state string required
State word.
text string? = null optional
Optional detail.

Properties

public static bool IsActive { get; } #

Whether the current execution context has a progress scope.

public static string? Target { get; } #

The ambient target, or null outside a scope.

public static string? Key { get; } #

The ambient item key, or null when unset.