-
-
Notifications
You must be signed in to change notification settings - Fork 5
ValueOutput Control
Iuga Alexandru edited this page Sep 2, 2018
·
2 revisions
Displays a value to the Console output.
- Custom label - The label displayed before the value.
- Writes any type of values - The ToString method is called to convert the value to a text.
- Custom color for the label - Specify the foreground and background colors for the label.
StringView.QuickWrite("Name:", "John Doe");
Result:
StringView firstNameView = new StringView("First Name:");
firstNameView.Label.ForegroundColor = ConsoleColor.DarkGreen;
StringView lastNameView = new StringView("Last Name:");
lastNameView.Label.ForegroundColor = ConsoleColor.DarkGreen;
Int32View ageView = new Int32View("Age:");
ageView.Label.ForegroundColor = ConsoleColor.DarkGreen;
firstNameView.Value = "Joe";
firstNameView.Write();
lastNameView.Value = "Doe";
lastNameView.Write();
ageView.Value = 25;
ageView.Write();
Result: