Example #1
0
        internal static TaskResult StartTask(ConsoleTask taskInstance)
        {
            if (taskInstance != null)
            {
                if (taskInstance.ConfirmStart())
                {
                    var clock = new Stopwatch();
                    clock.Start();
                    var result = taskInstance.StartTask();
                    taskInstance.Complete();

                    Console.WriteLine($"Completed in {clock.Elapsed.ToText()}");

                    return(result);
                }
                return(TaskResult.Failed("Unable to confirm task to start.", 1));
            }
            return(TaskResult.Failed($"No Task to start\n"));
        }
Example #2
0
 public TaskPackage AddTask(ConsoleTask task)
 {
     _tasks.Add(task);
     return(this);
 }