public override void Invoke(string[] param)
        {
            var color = QueryParam("Color", param, EnumExtensions.GetValues <ConsoleColor>().ToDictionary(x => x, x => x.ToString()));

            _consoleManager.ForegroundColor = color;
            _consoleManager.Clear();
        }
Example #2
0
        public void Run(string[] args)
        {
            string input = string.Empty;

            do
            {
                consoleManager.WriteLine("Welcome to my console app");
                consoleManager.WriteLine("[1] Say Hello?");
                consoleManager.WriteLine("[2] Say Goodbye?");
                consoleManager.WriteLine("");
                consoleManager.Write("Please enter a valid choice: ");

                input = consoleManager.ReadLine();

                if (input == "1" || input == "2")
                {
                    consoleManager.Write("Please enter your name: ");
                    string name = consoleManager.ReadLine();

                    if (input == "1")
                    {
                        consoleManager.WriteLine("Hello " + name);
                    }
                    else
                    {
                        consoleManager.WriteLine("Goodbye " + name);
                    }

                    consoleManager.WriteLine("");
                    consoleManager.Write("Press any key to exit... ");
                    consoleManager.ReadKey();
                }
                else
                {
                    consoleManager.Clear();
                }
            }while (input != "1" && input != "2" && input != "Exit");
        }
Example #3
0
 public void Clear()
 {
     _tagLocalLocation = new Dictionary <string, Location>();
     ConsoleManager.Clear();
 }
Example #4
0
 private void OnPlayfieldChanged(Frame[,] board)
 {
     _console.Clear();
     _console.ShowText(_gameMessageHolder.GetShortGameInformation(_currentGame.Moves));
     _console.DrawField(board);
 }