public void Start() { //--- Set the service target running flag IsServiceTargetRunning = true; //--- Start th active tasks foreach (Task Tsk in Tasks) { //--- Start the task if active if (Tsk.Active) { Tsk.Start(); } } //--- Start the task timer TaskTimer.Start(); }
public void Stop() { //--- Stop the task timer TaskTimer.Stop(); //--- Wait while running task exists while (RunningTask != null) { ; } //--- Dispose the tasks foreach (Task Tsk in Tasks) { Tsk.Dispose(); } //--- Clear the service target running flag IsServiceTargetRunning = false; }