public static void StartScheduledTasks() { if (running) { throw new InvalidOperationException("SchedulerLogic is already Running in {0}".FormatWith(Environment.MachineName)); } running = true; ReloadPlan(); SystemEventLogLogic.Log("Start ScheduledTasks"); }
public static void StopScheduledTasks() { if (!running) { throw new InvalidOperationException("SchedulerLogic is already Stopped in {0}".FormatWith(Environment.MachineName)); } lock (priorityQueue) { if (!running) { return; } running = false; timer.Change(Timeout.Infinite, Timeout.Infinite); priorityQueue.Clear(); } SystemEventLogLogic.Log("Stop ScheduledTasks"); }