Beispiel #1
0
 public override void Action()
 {
     if (_parameters == null || _parameters[0] == string.Empty)
     {
         Console.WriteLine(Description + ", message is empty");
     }
     else
     {
         Console.WriteLine(Description + " - printing message:" + _parameters[0]);
     }
     CommandLogger.SaveToFile(this);
 }
Beispiel #2
0
 public override void Action()
 {
     Console.WriteLine(Description);
     //show help section
     foreach (string str in HelpCommands)
     {
         Console.Write(str + " ");
     }
     Console.WriteLine("\t - help command.\n\t\t   Prints this message and list of available commands.\n");
     //show exit section
     foreach (string str in ExitCommands)
     {
         Console.Write(str + " ");
     }
     Console.WriteLine("\t - exit command.\n\t\t   Terminates application.\n");
     //show key-vlue section
     foreach (string str in KeyValueCommands)
     {
         Console.Write(str + " ");
     }
     Console.WriteLine("\t\t - key-value command.\n\t\t   Creates key-value pairs from user input.");
     Console.WriteLine("\t\t   User input <-k 1 qwerty 2> will result two pairs\n\t\t   to be created: 1-qwerty, 2-null.\n");
     //show ping section
     foreach (string str in PingCommands)
     {
         Console.Write(str + " ");
     }
     Console.WriteLine("\t\t - pinging command.\n\t\t   Creates fixed length \"beep\" sound from pc speaker.\n");
     //show print section
     foreach (string str in PrintCommands)
     {
         Console.Write(str + " ");
     }
     Console.WriteLine("\t\t - print command.\n\t\t   Prints message followed after command into console window.\n");
     //show getuser section
     foreach (string str in GetUserCommands)
     {
         Console.Write(str + " ");
     }
     Console.WriteLine("\t - get user command.\n\t\t   Prints current username. Default username is <anonym>.\n");
     //show setuser section
     foreach (string str in SetUserCommands)
     {
         Console.Write(str + " ");
     }
     Console.WriteLine("\t - set user command.\n\t\t   Changes current user. User input <-setuser qwerty> will");
     Console.WriteLine("\t\t   change current user to <qwerty>.\n");
     CommandLogger.SaveToFile(this);
 }
Beispiel #3
0
 public override void Action()
 {
     if (_parameters == null || _parameters[0] == string.Empty)
     {
         Console.WriteLine(Description + ", current user is reseted.");
         CommandLogger.SaveToFile(this);
         Program.User = string.Empty;
     }
     else
     {
         Console.WriteLine(Description + " - new user is set:" + _parameters[0]);
         CommandLogger.SaveToFile(this);
         Program.User = _parameters[0];
     }
 }
Beispiel #4
0
 public override void Action()
 {
     Console.Write(Description);
     if (_parameters != null)
     {
         Console.WriteLine(" - creating pairs:");
         for (int i = 0; i < _parameters.Length; i++)
         {
             Console.Write(_parameters[i++] + " = ");
             Console.Write(_parameters[i] + ";\n");
         }
     }
     else
     {
         Console.WriteLine(" without _parameters.");
     }
     CommandLogger.SaveToFile(this);
 }
Beispiel #5
0
 public override void Action()
 {
     Console.WriteLine("Command <" + Value + "> - " + "is not supported.");
     Console.WriteLine("Use </?> to see set of allowed commands, <-exit> to terminate");
     CommandLogger.SaveToFile(this);
 }
Beispiel #6
0
 public override void Action()
 {
     Console.WriteLine(Description);
     Commander.Exit = true;
     CommandLogger.SaveToFile(this);
 }
Beispiel #7
0
 public override void Action()
 {
     Console.WriteLine(Description + ", current user is - " + Program.User);
     CommandLogger.SaveToFile(this);
 }
Beispiel #8
0
 public override void Action()
 {
     Console.WriteLine(Description + " - pinging...");
     (new Thread(() => Console.Beep(500, 1000))).Start();
     CommandLogger.SaveToFile(this);
 }