AnsiConsoleExtensions Class

Contains extension methods for IAnsiConsole.
public static class AnsiConsoleExtensions
Namespace
Spectre.Console

Methods

static void AlternateScreen(IAnsiConsole, Action)
Switches to an alternate screen buffer if the terminal supports it.
static T Ask<T>(IAnsiConsole, string, CultureInfo)
Displays a prompt to the user.
static T Ask<T>(IAnsiConsole, string)
Displays a prompt to the user.
static void Clear(IAnsiConsole)
Clears the console.
static bool Confirm(IAnsiConsole, string, bool)
Displays a prompt with two choices, yes or no.
static Recorder CreateRecorder(IAnsiConsole)
Creates a recorder for the specified console.
static LiveDisplay Live(IAnsiConsole, IRenderable)
Creates a new LiveDisplay instance for the console.
static void Markup(IAnsiConsole, IFormatProvider, string, object[])
Writes the specified markup to the console.
static void Markup(IAnsiConsole, string, object[])
Writes the specified markup to the console.
static void Markup(IAnsiConsole, string)
Writes the specified markup to the console.
static void MarkupInterpolated(IAnsiConsole, FormattableString)
Writes the specified markup to the console.

All interpolation holes which contain a string are automatically escaped so you must not call EscapeMarkup(string).

static void MarkupInterpolated(IAnsiConsole, IFormatProvider, FormattableString)
Writes the specified markup to the console.

All interpolation holes which contain a string are automatically escaped so you must not call EscapeMarkup(string).

static void MarkupLine(IAnsiConsole, IFormatProvider, string, object[])
Writes the specified markup, followed by the current line terminator, to the console.
static void MarkupLine(IAnsiConsole, string, object[])
Writes the specified markup, followed by the current line terminator, to the console.
static void MarkupLine(IAnsiConsole, string)
Writes the specified markup, followed by the current line terminator, to the console.
static void MarkupLineInterpolated(IAnsiConsole, FormattableString)
Writes the specified markup, followed by the current line terminator, to the console.

All interpolation holes which contain a string are automatically escaped so you must not call EscapeMarkup(string).

static void MarkupLineInterpolated(IAnsiConsole, IFormatProvider, FormattableString)
Writes the specified markup, followed by the current line terminator, to the console.

All interpolation holes which contain a string are automatically escaped so you must not call EscapeMarkup(string).

static Progress Progress(IAnsiConsole)
Creates a new Progress(IAnsiConsole) instance for the console.
static T Prompt<T>(IAnsiConsole, IPrompt<T>)
Displays a prompt to the user.
static void Render(IAnsiConsole, IRenderable)
Renders the specified object to the console.
static T RunExclusive<T>(IAnsiConsole, Func<T>)
Runs the specified function in exclusive mode.
static Task<T> RunExclusive<T>(IAnsiConsole, Func<Task<T>>)
Runs the specified function in exclusive mode asynchronously.
static Status Status(IAnsiConsole)
Creates a new Status(IAnsiConsole) instance for the console.
static void Write(IAnsiConsole, string, Style)
Writes the specified string value to the console.
static void Write(IAnsiConsole, string)
Writes the specified string value to the console.
static void WriteException(IAnsiConsole, Exception, ExceptionFormats)
Writes an exception to the console.
static void WriteException(IAnsiConsole, Exception, ExceptionSettings)
Writes an exception to the console.
static void WriteLine(IAnsiConsole, string, Style)
Writes the specified string value, followed by the current line terminator, to the console.
static void WriteLine(IAnsiConsole, string)
Writes the specified string value, followed by the current line terminator, to the console.
static void WriteLine(IAnsiConsole)
Writes an empty line to the console.