Exemplo n.º 1
0
        private void PrintStartScreen()
        {
            Version version = Assembly.GetExecutingAssembly().GetName().Version;

            if (version is not null)
            {
                SimpleUi.Print($"Jobb V{version}");
            }
        }
Exemplo n.º 2
0
 private void PrintCurrentlyActiveJobbs()
 {
     foreach (var jobb in JobbList)
     {
         SimpleUi.Print($"Name: {jobb.Parameters.Name}");
         SimpleUi.Print($"Time Period: {jobb.Parameters.Schedule.Period.ToString()}");
         SimpleUi.Print($"Interval: {jobb.Parameters.Schedule.Unit.ToString()}");
         SimpleUi.Print($"Current state: {jobb.Parameters.ReturnCode.ToString()}");
     }
 }
Exemplo n.º 3
0
        private void RemoveJobb()
        {
            SimpleUi.PrintWithColor("Press the number of the Jobb you wish to remove: ", ConsoleColor.Green);
            for (int i = 0; i < JobbList.Count; i++)
            {
                SimpleUi.Print($"[{i}] {JobbList[i].Parameters.Name}");
            }

            string chosenJobb      = SimpleUi.ReadLine();
            int    chosenJobbIndex = int.Parse(chosenJobb);

            JobbList[chosenJobbIndex].StopTimer();
            JobbList.RemoveAt(chosenJobbIndex);
            SimpleUi.Print("Job removed.");
        }