Esempio n. 1
0
        public void ReaderKeys(JobExecutor je, Action action, int numberJob)
        {
            while (true)
            {
                var keys = Console.ReadLine();
                if (keys == "1" || keys == "2" || keys == "3" || keys == "4")
                {
                    switch (keys)
                    {
                    case "1":
                        AddName(je, action, numberJob);
                        break;

                    case "2":
                        je.Start(4);
                        break;

                    case "3":
                        ClearQueue(je, action);
                        break;

                    case "4":
                        StopJob(je, action);
                        break;
                    }
                }
                else
                {
                    Console.WriteLine("Не верный символ попробуйте еще раз.");
                }
            }
        }
Esempio n. 2
0
 private void AddName(JobExecutor je, Action action, int numberJob)
 {
     for (int i = 0; i < numberJob; i++)
     {
         je.Add(action);
     }
     Console.WriteLine($"В очередь добавлено {numberJob} записей");
 }
Esempio n. 3
0
 private void StopJob(JobExecutor je, Action action)
 {
     je.Stop();
 }
Esempio n. 4
0
 private void ClearQueue(JobExecutor je, Action action)
 {
     je.Clear();
 }