Exemplo n.º 1
0
        public static void ScheduleJob(string id, DateTime startTime, IntervalType intervalType, int interval = 1)
        {
            var startTimer = TimerHelper.GetInitialTimer(startTime);
            var scheduler  = _schedulerFactory.New(id, startTimer);

            scheduler.Timer.Elapsed += (sender, e) => _eventHandler.HandleStartEvent(id, SchedulerType.Parent, intervalType, interval);
        }
Exemplo n.º 2
0
        public void HandleStartEvent(string schedulerName, SchedulerType schedulerType, IntervalType intervalType, int interval, RepeatInterval repeatInterval = RepeatInterval.None, int repeatIntervalValue = 0)
        {
            ProcessTask(schedulerName);
            var delay     = TimerHelper.Getinterval(intervalType, interval);
            var scheduler = _schedulerFactory.New(schedulerName, delay);

            AddEventHandler(scheduler, intervalType, repeatInterval, repeatIntervalValue);
        }