public void ScheduleTask <TPage>(int intervalTimeInMs, Action <TPage> action, int delay = 0, bool preExecute = false) where TPage : Page { if (State.PeriodicTaskEntries == null) { State.PeriodicTaskEntries = new List <IPeriodicTaskEntry>(); } var taskEntry = new PortablePeriodicTaskEntry <TPage>(Page, action, intervalTimeInMs); State.PeriodicTaskEntries.Add(taskEntry); taskEntry.Task.Run(delay, preExecute); }
public void ScheduleTaskEveryMinute <TPage>(Action <TPage> action) where TPage : Page { if (State.PeriodicTaskEntries == null) { State.PeriodicTaskEntries = new List <IPeriodicTaskEntry>(); } var taskEntry = new PortablePeriodicTaskEntry <TPage>(Page, action); State.PeriodicTaskEntries.Add(taskEntry); taskEntry.Task.RunEveryMinute(); }