Hyena.Jobs.Job.Cancel C# (CSharp) Method

Cancel() private method

private Cancel ( ) : void
return void
        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);
        }

Usage Example

Esempio n. 1
0
 public void Cancel(Job job)
 {
     lock (jobs) {
         if (jobs.Contains(job))
         {
             // Cancel will call OnJobFinished which will call Schedule
             job.Cancel();
         }
     }
 }
All Usage Examples Of Hyena.Jobs.Job::Cancel