internal void Cancel () { lock (sync) { if (!IsFinished) { IsCancelRequested = true; State = JobState.Cancelled; EventHandler handler = CancelRequested; if (handler != null) { handler (this, EventArgs.Empty); } } } Log.Debug ("Canceled", Title); }
public void Cancel(Job job) { lock (jobs) { if (jobs.Contains(job)) { // Cancel will call OnJobFinished which will call Schedule job.Cancel(); } } }