public static void SetGridTimer() { var timer = TimerUtils.CreateTimer(() => GridActions.InvokeFormIfRequired(), 2000, 2000); var taskTimer = TimerUtils.AddTimer(timer, "Grid", "Grid Updater", 2000, 2000); }
public static void UpdateStatusConsecutively(Task task) { Timer timer = null; timer = TimerUtils.CreateTimer(() => TaskActions.UpdateStatusForConsecutiveTask(timer, task), 3000, 3000); var taskTimer = TimerUtils.AddTimer(timer, task.Name, "Consecutive Checker Timer", 3000, 3000); }
public static void UpdateStatusForLoaded(Task task) { Timer timer = null; timer = TimerUtils.CreateTimer(() => TaskActions.UpdateForLoadedTask(timer, task), 3000, 3000); var taskTimer = TimerUtils.AddTimer(timer, task.Name, "Loaded Task Updater", 3000, 3000); }
public static void UpdateStatusEverySeconds(Task task) { Timer timer = null; timer = TimerUtils.CreateTimer(() => TaskActions.UpdateTasksRunningStatus(timer, task), 3000, 3000); TimerUtils.AddTimer(timer, task.Name, "Task Status Updater", 3000, 3000); }
public static void SetTaskStartingTimer(Task task) { var dueTime = TimeSpanUtils.GetMillisecondsFromNow(task.Period.StartDate); Timer timer = null; timer = TimerUtils.CreateTimer(() => TaskActions.StartTaskThenDisposeTimer(timer, task), dueTime, Timeout.Infinite); var taskTimer = TimerUtils.AddTimer(timer, task.Name, "Task Starting Timer", dueTime, -1); }
public static void RunTaskPeriodically(Task task) { var dueTime = TimeSpan.Zero; var period = task.Period.TimeBetween; System.Threading.Timer timer = null; timer = TimerUtils.CreateTimer(() => TaskActions.RunTaskDisposeIfNull(timer, task), dueTime, period); var taskTimer = TimerUtils.AddTimer(timer, task.Name, "Periodical Runner Timer", dueTime, period); logger.Info($"{taskTimer} is added."); }
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); }