Add AnsiConsole.Write method

This commit also obsoletes the `AnsiConsole.Render` method.

Closes #576
This commit is contained in:
Patrik Svensson
2021-10-05 00:45:46 +02:00
committed by Phil Scott
parent ca2e6ce0ad
commit e0395dfa2b
19 changed files with 49 additions and 39 deletions

View File

@ -8,20 +8,20 @@ namespace Spectre.Console.Examples
"[underline]I[/] heard [underline on blue]you[/] like panels\n\n\n\n" +
"So I put a panel in a panel").Centered();
AnsiConsole.Render(
AnsiConsole.Write(
new Panel(
new Panel(content)
.Border(BoxBorder.Rounded)));
// Left adjusted panel with text
AnsiConsole.Render(
AnsiConsole.Write(
new Panel(new Text("Left adjusted\nLeft").LeftAligned())
.Expand()
.SquareBorder()
.Header("[red]Left[/]"));
// Centered ASCII panel with text
AnsiConsole.Render(
AnsiConsole.Write(
new Panel(new Text("Centered\nCenter").Centered())
.Expand()
.AsciiBorder()
@ -29,7 +29,7 @@ namespace Spectre.Console.Examples
.HeaderAlignment(Justify.Center));
// Right adjusted, rounded panel with text
AnsiConsole.Render(
AnsiConsole.Write(
new Panel(new Text("Right adjusted\nRight").RightAligned())
.Expand()
.RoundedBorder()