public DateTime ScheduleJob(IScheduledJob job, Trigger trigger)
        {
            if (job == null)
            {
                throw new SchedulerException("Job cannot be null", SchedulerException.ErrorClientError);
            }
            if (trigger == null)
            {
                throw new SchedulerException("Trigger cannot be null", SchedulerException.ErrorClientError);
            }
            if (trigger.JobName == null)
            {
                trigger.JobName = job.Name;
            }
            NullableDateTime ft = trigger.ComputeFirstFireTimeUtc();

            if (!ft.HasValue)
            {
                throw new SchedulerException("Based on configured schedule, the given trigger will never fire.", SchedulerException.ErrorClientError);
            }
            StoreJobAndTrigger(job, trigger);
            NotifySchedulerThread();
            return(ft.Value);
        }
 public DateTime ScheduleJob(IScheduledJob job, Trigger trigger)
 {
     if (job == null)
         throw new SchedulerException("Job cannot be null", SchedulerException.ErrorClientError);
     if (trigger == null)
         throw new SchedulerException("Trigger cannot be null", SchedulerException.ErrorClientError);
     if (trigger.JobName == null)
         trigger.JobName = job.Name;
     NullableDateTime ft = trigger.ComputeFirstFireTimeUtc();
     if (!ft.HasValue)
         throw new SchedulerException("Based on configured schedule, the given trigger will never fire.", SchedulerException.ErrorClientError);
     StoreJobAndTrigger(job, trigger);
     NotifySchedulerThread();
     return ft.Value;
 }