Beispiel #1
0
        public TimeSpan GetDontRunLongerThanValue()
        {
            var every      = (float)runsLongerThanEvery.Value;
            var longerThan = IntervalUtils.GetDontRunLongerThanInterval();

            return(TimeSpanUtils.GenerateTimeSpan(every, longerThan));
        }
Beispiel #2
0
        public static void StartDelayForConsecutive(Task task)
        {
            var startConsecutivelyValue = (float)form.StartConsecutivelyDelay.Value;

            var delay = (long)
                        TimeSpanUtils
                        .GenerateTimeSpan(startConsecutivelyValue, IntervalUtils.GetInterval())
                        .TotalMilliseconds;

            Timer timer = null;

            TimerUtils.CreateTimer(() =>

                                   TaskActions.RunTaskUpdateTaskDisposeTimer(timer, task), delay, Timeout.Infinite);

            var taskTimer = TimerUtils.AddTimer(timer, task.Name, "Consecutive Delayer Timer", delay, -1);
        }
Beispiel #3
0
        public static TimeSpan GetTimeBetween(StartProperty prop)
        {
            float    every;
            Interval interval;

            if (prop == StartProperty.Periodically)
            {
                every    = (float)MainForm.Form.StartPeriodicallyEvery.Value;
                interval = IntervalUtils.GetInterval();
            }
            else
            {
                every    = (float)MainForm.Form.StartConsecutivelyDelay.Value;
                interval = IntervalUtils.GetInterval();
            }

            return(TimeSpanUtils.GenerateTimeSpan(every, interval));
        }