Esempio n. 1
0
        private void UpdateTimer()
        {
            if (scheduledPrograms.Count == 0)
            {
                timerController.CancelStart();
                return;
            }
            else
            {
                var waitseconds = scheduledPrograms.Select(x => Programs[x]).Min(x => x.TimeToWait);

                timerController.ScheduleStart(waitseconds);
            }
        }
Esempio n. 2
0
        private void ScheduleParse(bool runLoad)
        {
            var parse = new ParserTask(Current.Me.CustomData);

            parse.Done = r =>
            {
                if (r.Item1 != null)
                {
                    Log.Write(LOG_CAT, LogLevel.Verbose, "Parsing done");
                    runtime.RegisterPrograms(r.Item1);
                    if (runLoad)
                    {
                        if (runtime.StartProgram("_load", true))
                        {
                            timerController.ScheduleStart(0);
                        }
                    }
                }
            };
            sch.EnqueueTask(parse);
        }