/// <summary> /// 執行任務 /// </summary> /// <param name="taskType">任務類型</param> /// <param name="configManager">設定管理物件</param> /// <param name="schedule">排程管理物件</param> private void ExecuteTask(string taskType, ConfigManager configManager, Schedule schedule) { foreach (var config in configManager.Configs) { IFileFinder fileFinder = FileFinderFactory.Create("file", config); if (schedule == null || schedule.Ext == config.Ext) { foreach (Candidate candidate in fileFinder) { this.task = TaskFactory.Create(taskType); this.task.Execute(config, schedule); } } } }
/// <summary> /// 執行 /// </summary> /// <param name="config">設定檔物件</param> /// <param name="schedule">排程檔物件</param> public virtual void Execute(Config config, Schedule schedule) { this.fileFinder = FileFinderFactory.Create("file", config); }