示例#1
0
        private static int AskForId()
        {
            Int32View idView = new Int32View("The id of the person:");

            int id = idView.Read();

            CustomConsole.WriteLine();

            return(id);
        }
        public void Execute()
        {
            StringView.QuickWrite("First Name:", "John");
            StringView.QuickWrite("Last Name:", "Doe");
            Int32View.QuickWrite("Age:", 25);

            // or

            ValueView <string> .QuickWrite("First Name:", "John");

            ValueView <string> .QuickWrite("Last Name:", "Doe");

            ValueView <int> .QuickWrite("Age:", 25);
        }
        public void Execute()
        {
            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();
        }