/// <summary> /// Shows the options. /// </summary> private void ShowOptions() { Console.Clear(); foreach (var option in OptionsService.GetValidOptions()) { Console.WriteLine($"- {option.Key}\t{option.FunctionName}"); } Console.WriteLine("- <Esc>\tExit"); }
/// <summary> /// The run method. /// </summary> public void Run() { var option = String.Empty; ShowOptions(); while (option != null) { option = ReadLineWithCancel(); if (!OptionsService.ValidateOption(option)) { Console.WriteLine($"{Environment.NewLine}Invalid option. Try again."); continue; } Console.WriteLine($"{Environment.NewLine}{GetFunction( option )}"); ExecuteFunction(option.OptionToFunction()); } }