private bool ScheduleTrigger(TimeTriggerCommandArgs ttca) { var job = new JobDetail(ttca.ActionName + jobSuffix, typeof(ActionJob)); job.JobDataMap["action"] = ttca.Action; job.Group = jobsGroup; Trigger trigger = ttca.TimeTrigger; trigger.Name = ttca.ActionName + triggerSuffix; this.ScheduleTriggerForJob(job, trigger); return(true); }
public override bool Unschedule() { this.scheduled = false; var args = new TimeTriggerCommandArgs(this.Name + " " + this.TypeName); return this.RemoveExistingTimeTrigger(args); }
private bool ScheduleTrigger(TimeTriggerCommandArgs ttca) { var job = new JobDetail(ttca.ActionName + jobSuffix, typeof(ActionJob)); job.JobDataMap["action"] = ttca.Action; job.Group = jobsGroup; Trigger trigger = ttca.TimeTrigger; trigger.Name = ttca.ActionName + triggerSuffix; this.ScheduleTriggerForJob(job, trigger); return true; }
public void StopPomodoroInternal(bool completed) { this.previousPomodoro = this.pomodoroData; this.pomodoroData = null; var args = new TimeTriggerCommandArgs("Finish Pomodoro"); this.removeExistingTimeTriggerCommand.Do(args); // should be removed in case the user voided the pomodoro // remove the trigger as of no need this.removeExistingTriggerCommand.Do(new TimeTriggerCommandArgs("Pomodoro Minute Elapsed")); this.previousPomodoro.Successful = completed; this.previousPomodoro.Duration = this.Now - this.previousPomodoro.Start; this.pomodoroFinishingEvent.Fire(new PomodoroEventArgs(this.previousPomodoro)); this.pomodoroFinishedEvent.Fire(new PomodoroEventArgs(this.previousPomodoro)); }
protected bool RemoveExistingTimeTrigger(TimeTriggerCommandArgs ttca) { return (bool)this.removeExistingTimeTriggerCommand.Do(ttca); }