Lists and Calendars
Listing items in your console
List of renderers
1
Tables and Calendars
var Rows = new string[,]
{
{ "Ubuntu Version", "Release Date", "Support End", "ESM Support End" },
{ "12.04 (Precise Pangolin)", new DateTime(2012, 4, 26).ToString(), new DateTime(2017, 4, 28).ToString(), new DateTime(2019, 4, 28).ToString() },
{ "14.04 (Trusty Tahr)", new DateTime(2014, 4, 17).ToString(), new DateTime(2019, 4, 25).ToString(), new DateTime(2024, 4, 25).ToString() },
{ "16.04 (Xenial Xerus)", new DateTime(2016, 4, 21).ToString(), new DateTime(2021, 4, 30).ToString(), new DateTime(2026, 4, 30).ToString() },
{ "18.04 (Bionic Beaver)", new DateTime(2018, 4, 26).ToString(), new DateTime(2023, 4, 30).ToString(), new DateTime(2028, 4, 30).ToString() },
{ "20.04 (Focal Fossa)", new DateTime(2020, 4, 23).ToString(), new DateTime(2025, 4, 25).ToString(), new DateTime(2030, 4, 25).ToString() },
{ "22.04 (Jammy Jellyfish)", new DateTime(2022, 4, 26).ToString(), new DateTime(2027, 4, 25).ToString(), new DateTime(2032, 4, 25).ToString() },
{ "24.04 (Noble Numbat)", new DateTime(2024, 4, 25).ToString(), new DateTime(2029, 4, 25).ToString(), new DateTime(2034, 4, 25).ToString() },
};
var misc = new Table()
{
Rows = Rows,
Header = true,
Left = 4,
Top = 2,
InteriorWidth = ConsoleWrapper.WindowWidth - 7,
InteriorHeight = ConsoleWrapper.WindowHeight - 5,
Settings =
[
new CellOptions(2, 2) { CellColor = ConsoleColors.Red, CellBackgroundColor = ConsoleColors.DarkRed, ColoredCell = true },
new CellOptions(3, 2) { CellColor = ConsoleColors.Red, CellBackgroundColor = ConsoleColors.DarkRed, ColoredCell = true },
new CellOptions(4, 2) { CellColor = ConsoleColors.Red, CellBackgroundColor = ConsoleColors.DarkRed, ColoredCell = true },
new CellOptions(2, 3) { CellColor = ConsoleColors.Red, CellBackgroundColor = ConsoleColors.DarkRed, ColoredCell = true },
new CellOptions(3, 3) { CellColor = ConsoleColors.Red, CellBackgroundColor = ConsoleColors.DarkRed, ColoredCell = true },
new CellOptions(4, 3) { CellColor = ConsoleColors.Red, CellBackgroundColor = ConsoleColors.DarkRed, ColoredCell = true },
new CellOptions(2, 4) { CellColor = ConsoleColors.Yellow, CellBackgroundColor = ConsoleColors.Olive, ColoredCell = true },
new CellOptions(3, 4) { CellColor = ConsoleColors.Yellow, CellBackgroundColor = ConsoleColors.Olive, ColoredCell = true },
new CellOptions(2, 5) { CellColor = ConsoleColors.Yellow, CellBackgroundColor = ConsoleColors.Olive, ColoredCell = true },
new CellOptions(3, 5) { CellColor = ConsoleColors.Yellow, CellBackgroundColor = ConsoleColors.Olive, ColoredCell = true },
]
};
TextWriterRaw.WriteRaw(misc.Render());


2
3
Selection
var finalSelections = new InputChoiceInfo[]
{
new("Choice one", "The first choice"),
new("Choice two", "The second choice"),
new("Choice three", "The third choice"),
new("Choice four", "The fourth choice"),
new("Choice five", "The fifth choice"),
new("Choice six", "The sixth choice"),
new("Choice seven", "The seventh choice"),
new("Choice eight", "The eighth choice"),
};
var selections = new Selection(finalSelections)
{
Left = 2,
Top = 1,
CurrentSelection = 2,
Height = 7,
Width = 30,
};
TextWriterRaw.WriteRaw(selections.Render());


4
Simple Selection
var finalSelections = new InputChoiceInfo[]
{
new("Choice one", "The first choice"),
new("Choice two", "The second choice"),
new("Choice three", "The third choice"),
new("Choice four", "The fourth choice"),
new("Choice five", "The fifth choice"),
new("Choice six", "The sixth choice"),
new("Choice seven", "The seventh choice"),
new("Choice eight", "The eighth choice"),
};
var selections = new PassiveSelection(finalSelections);
TextWriterRaw.WriteRaw(selections.Render());

Last updated


