NanoByte.Common 2.11.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.
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.

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.

◆ 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 

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