コード例 #1
0
 /// <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);
 }
コード例 #2
0
        /// <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;
                }
            }
        }
コード例 #3
0
 public override void Execute()
 {
     MethodsOutput.PrintLocalStringLine("HELP");
 }
コード例 #4
0
        /// <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());
        }