Compare commits
2 Commits
cceaa95735
...
017aae6782
| Author | SHA1 | Date | |
|---|---|---|---|
| 017aae6782 | |||
| 5fb336b84a |
@ -100,36 +100,69 @@
|
|||||||
//// AnsiConsole.MarkupLine($"[bold red]{name}[/]");
|
//// AnsiConsole.MarkupLine($"[bold red]{name}[/]");
|
||||||
////}
|
////}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
// Lesson 7 - Adding tables to your console
|
// Lesson 7 - Adding tables to your console
|
||||||
|
|
||||||
List<Text> person = [
|
////List<Text> person = [
|
||||||
new("Bilbo"),
|
//// new("Bilbo"),
|
||||||
new("Baggins"),
|
//// new("Baggins"),
|
||||||
new("111")
|
//// new("111")
|
||||||
];
|
////];
|
||||||
|
|
||||||
Table table = new Table();
|
////Table table = new Table();
|
||||||
table.Centered();
|
////table.Centered();
|
||||||
//table.Expand();
|
//////table.Expand();
|
||||||
//table.Border(TableBorder.Double);
|
//////table.Border(TableBorder.Double);
|
||||||
table.Border(TableBorder.Rounded);
|
////table.Border(TableBorder.Rounded);
|
||||||
table.ShowRowSeparators();
|
////table.ShowRowSeparators();
|
||||||
|
|
||||||
table.AddColumn("First Name");
|
////table.AddColumn("First Name");
|
||||||
table.AddColumn("Last Name");
|
////table.AddColumn("Last Name");
|
||||||
table.AddColumn("Age");
|
////table.AddColumn("Age");
|
||||||
|
|
||||||
table.Columns[0].PadLeft(5).PadRight(5);
|
////table.Columns[0].PadLeft(5).PadRight(5);
|
||||||
table.Columns[1].Width(15);
|
////table.Columns[1].Width(15);
|
||||||
table.Columns[2].RightAligned();
|
////table.Columns[2].RightAligned();
|
||||||
|
|
||||||
table.AddRow("Tim", "Corey", "46");
|
////table.AddRow("Tim", "Corey", "46");
|
||||||
table.AddRow("Sue", "Storm", "23");
|
////table.AddRow("Sue", "Storm", "23");
|
||||||
table.AddRow(person);
|
////table.AddRow(person);
|
||||||
|
|
||||||
AnsiConsole.Write(table);
|
////AnsiConsole.Write(table);
|
||||||
|
|
||||||
|
|
||||||
|
//Lesson 8 - Panels
|
||||||
|
////List<string> names = [
|
||||||
|
//// "Tim Corey",
|
||||||
|
//// "Sue Storm",
|
||||||
|
//// "[red]Bilbo Baggins[/]",
|
||||||
|
//// "John Doe",
|
||||||
|
//// "Princess Donaut",
|
||||||
|
//// "Steve Rogers"
|
||||||
|
////];
|
||||||
|
|
||||||
|
////string panelInfo = string.Join("\n", names);
|
||||||
|
//////Panel panel = new Panel(panelInfo);
|
||||||
|
////Panel panel = new(new Markup(panelInfo).Centered());
|
||||||
|
////panel.Header = new PanelHeader("Default names");
|
||||||
|
////panel.Border = BoxBorder.Rounded;
|
||||||
|
////panel.Padding(2, 1);
|
||||||
|
|
||||||
|
////AnsiConsole.Write(panel);
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
// Lesson 9 - FIGlet Text
|
||||||
|
|
||||||
|
AnsiConsole.Write(new FigletText("Hello")
|
||||||
|
.Centered()
|
||||||
|
.Color(Color.Red)
|
||||||
|
);
|
||||||
|
|
||||||
|
FigletText figlet = new("World");
|
||||||
|
figlet.Centered();
|
||||||
|
figlet.Color(Color.Red);
|
||||||
|
|
||||||
|
AnsiConsole.Write(figlet);
|
||||||
|
|
||||||
Console.ReadLine();
|
Console.ReadLine();
|
||||||
AnsiConsole.Clear();
|
AnsiConsole.Clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user