public TimeSpan GetDontRunLongerThanValue() { var every = (float)runsLongerThanEvery.Value; var longerThan = IntervalUtils.GetDontRunLongerThanInterval(); return(TimeSpanUtils.GenerateTimeSpan(every, longerThan)); }
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); }
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)); }
public static EmailInfo SetEmailInfo() { if (MainForm.Form.NotifyButton.Checked) { float every = (float)MainForm.Form.RunsLongerThanEvery.Value; var interval = GetSelectedRunsLongerThanInterval(); EmailInfo emailInfo = new EmailInfo { IsToBeNotified = true, EmailAddresses = GetTextBoxEmailsList(), NoLongerThan = TimeSpanUtils.GenerateTimeSpan(every, interval) }; return(emailInfo); } else { return(null); } }