-
-
Notifications
You must be signed in to change notification settings - Fork 5
ListOutput Control
Iuga Alexandru edited this page Jan 7, 2018
·
2 revisions
Displays a list of items to the Console output.
- Optional label - Displays a text label at the top of the list.
- Custom color for the label - The label can be written with different foreground and background colors.
- Custom bullet - Displays custom bullet in front of each item.
- Custom space amount after the bullet - Can specify the amount of space to be displayed between the bullet and the value.
- Custom items indentation - Specify the amount of space left empty in front of the items.
string[] colorNames = Enum.GetNames(typeof(ConsoleColor));
ListOutput.QuickWrite("Colors:", colors);
Result:
ListOutput colorsOutput = new ListOutput();
colorsOutput.Bullet = "#";
colorsOutput.LabelForegroundColor = ConsoleColor.Cyan;
// etc...
colorsOutput.Write("Colors:", colors);
Result: