/// <summary> /// Reading commands until user wants to quit. /// </summary> private void ManagerLoop() { do { ReadCommandLine(); MethodsOutput.SkipLine(); MethodsOutput.PrintLocalStringLine("COMMAND_SUCCESS"); MethodsOutput.PrintLocalStringLine("ESC_TO_EXIT"); MethodsOutput.SkipLine(); } while (Console.ReadKey(true).Key != ConsoleKey.Escape); }
/// <summary> /// Loop for reading command line until recognize. /// </summary> private void ReadCommandLine() { bool isInLoop = true; while (isInLoop) { try { CommandByArguments(MethodsInput.ReadStringPrefixPath()); isInLoop = false; } catch (Exception e) { MethodsOutput.PrintStringLine(e.Message); isInLoop = true; } } }
public override void Execute() { MethodsOutput.PrintLocalStringLine("HELP"); }
/// <summary> /// Reading string line printing some <paramref name="prefix" /> before. /// </summary> /// <param name="prefix"> Some prefix to print. </param> /// <returns> Read line. </returns> public static string ReadStringPrefix(string prefix) { MethodsOutput.PrintString(prefix); return(Console.ReadLine()); }