Ejemplo n.º 1
0
        private bool ScheduleAction(SingleActionCommandArgs saca)
        {
            var job = new JobDetail(saca.ActionName + jobSuffix, typeof(ActionJob));

            job.JobDataMap["action"] = new Action(() =>
            {
                this.sched.DeleteJob(job.Name, jobsGroup);
                saca.Action();
            });
            Trigger trigger = new SimpleTrigger(
                saca.ActionName + triggerSuffix,
                saca.LocalTime.ToUniversalTime());

            this.ScheduleTriggerForJob(job, trigger);
            System.Diagnostics.Trace.WriteLine("Will be triggered at " + saca.LocalTime);

            return(true);
        }
        private bool ScheduleAction(SingleActionCommandArgs saca)
        {
            var job = new JobDetail(saca.ActionName + jobSuffix, typeof(ActionJob));
            job.JobDataMap["action"] = new Action(() =>
                {
                    this.sched.DeleteJob(job.Name, jobsGroup);
                    saca.Action();
                });
            Trigger trigger = new SimpleTrigger(
                saca.ActionName + triggerSuffix,
                saca.LocalTime.ToUniversalTime());
            this.ScheduleTriggerForJob(job, trigger);
            System.Diagnostics.Trace.WriteLine("Will be triggered at " + saca.LocalTime);

            return true;
        }
 protected void ScheduleSingleAction(SingleActionCommandArgs saca)
 {
     this.scheduleActionCommand.Do(saca);
 }