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(); }
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"); }
public void Clear() { _tagLocalLocation = new Dictionary <string, Location>(); ConsoleManager.Clear(); }
private void OnPlayfieldChanged(Frame[,] board) { _console.Clear(); _console.ShowText(_gameMessageHolder.GetShortGameInformation(_currentGame.Moves)); _console.DrawField(board); }