/// <summary>
        /// 排程任務
        /// </summary>
        /// <param name="managers">管理物件</param>
        public void ScheduledTask(List <JsonManager> managers)
        {
            ConfigManager   configManager   = managers[0] as ConfigManager;
            ScheduleManager scheduleManager = managers[1] as ScheduleManager;

            foreach (var schedule in scheduleManager.Schedules)
            {
                this.ExecuteTask("scheduled", configManager, schedule);
            }

            Console.WriteLine("scheduled task done.");
        }
Beispiel #2
0
        public void ScheduledTask(List <JsonManager> managers)
        {
            this.task = TaskFactory.Create("scheduled");
            ConfigManager   configManager   = managers[0] as ConfigManager;
            ScheduleManager scheduleManager = managers[1] as ScheduleManager;

            foreach (var config in configManager.configs)
            {
                var schedule = scheduleManager.schedules.FirstOrDefault(x => x.Ext == config.Ext);
                if (schedule != null)
                {
                    this.task.Execute(config, schedule);
                }
            }
        }