Class AnsiCli
Helper methods for ANSI console rendering.
Namespace: NanoByte.Common
Assembly: NanoByte.Common.AnsiCli.dll
Syntax
public class AnsiCli : Object
Constructors
AnsiCli()
Declaration
public AnsiCli()
Properties
Error
Used to write to the standard error stream.
Declaration
public static IAnsiConsole Error { get; }
Property Value
Type | Description |
---|---|
Spectre.Console.IAnsiConsole |
Methods
Prompt<T>(TextPrompt<T>, CancellationToken)
Displays a prompt to the user.
Declaration
public static T Prompt<T>(TextPrompt<T> prompt, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Spectre.Console.TextPrompt<T> | prompt | The prompt to display. |
CancellationToken | cancellationToken | Used to cancel the prompt. |
Returns
Type | Description |
---|---|
T | The prompt input result. |
Type Parameters
Name | Description |
---|---|
T | The prompt result type. |
Table<T>(IEnumerable<T>)
Formats data as a table.
Declaration
public static IRenderable Table<T>(IEnumerable<T> data)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | data | The data to format. |
Returns
Type | Description |
---|---|
Spectre.Console.Rendering.IRenderable |
Type Parameters
Name | Description |
---|---|
T |
Title(String)
Formats text as a title.
Declaration
public static IRenderable Title(string title)
Parameters
Type | Name | Description |
---|---|---|
String | title |
Returns
Type | Description |
---|---|
Spectre.Console.Rendering.IRenderable |
Tree<T>(NamedCollection<T>, Char)
Formats data as a tree.
Declaration
public static IRenderable Tree<T>(NamedCollection<T> data, char separator = '|')
where T : INamed
Parameters
Type | Name | Description |
---|---|---|
NamedCollection<T> | data | The data to show as nodes in the tree. |
Char | separator | The character used to split Names into tree levels. |
Returns
Type | Description |
---|---|
Spectre.Console.Rendering.IRenderable |
Type Parameters
Name | Description |
---|---|
T |