NanoByte.Common  2.9.0
NanoByte.Common.AnsiCli Class Reference

Helper methods for ANSI console rendering. More...

Static Public Member Functions

static T Prompt< T > (TextPrompt< T > prompt, CancellationToken cancellationToken)
 Displays a prompt to the user. More...
static IRenderable Title (string title)
 Formats text as a title. More...
static IRenderable Table< T > (IEnumerable< T > data)
 Formats data as a table. More...
static IRenderable Tree< T > (NamedCollection< T > data, char separator=Named.TreeSeparator)
 Formats data as a tree. More...


static IAnsiConsole Error = AnsiConsole.Create(new AnsiConsoleSettings {Out = new AnsiConsoleOutput(Console.Error)}) [get]
 Used to write to the standard error stream. More...

Detailed Description

Helper methods for ANSI console rendering.

Member Function Documentation

◆ Prompt< T >()

static T NanoByte.Common.AnsiCli.Prompt< T > ( TextPrompt< T >  prompt,
CancellationToken  cancellationToken 

Displays a prompt to the user.

Template Parameters
TThe prompt result type.
promptThe prompt to display.
cancellationTokenUsed to cancel the prompt.
The prompt input result.

◆ Table< T >()

static IRenderable NanoByte.Common.AnsiCli.Table< T > ( IEnumerable< T >  data)

Formats data as a table.

dataThe data to format.

◆ Title()

static IRenderable NanoByte.Common.AnsiCli.Title ( string  title)

Formats text as a title.

◆ Tree< T >()

static IRenderable NanoByte.Common.AnsiCli.Tree< T > ( NamedCollection< T >  data,
char  separator = Named.TreeSeparator 

Formats data as a tree.

dataThe data to show as nodes in the tree.
separatorThe character used to split INamed.Names into tree levels.
Type Constraints
T :INamed 

Property Documentation

◆ Error

IAnsiConsole NanoByte.Common.AnsiCli.Error = AnsiConsole.Create(new AnsiConsoleSettings {Out = new AnsiConsoleOutput(Console.Error)})

Used to write to the standard error stream.

The documentation for this class was generated from the following file: