コード例 #1
0
        public static void Start(string[] args)
        {
            if (!System.IO.Directory.Exists(ConfigurationManager.AppSettings["TempFolderPath"]))
            {
                System.IO.Directory.CreateDirectory(ConfigurationManager.AppSettings["TempFolderPath"]);
            }
            BrowserWatcherBase.InitializeEnvironment();
            var schedule = new Schedule(ConfigurationManager.AppSettings["Frequency"],
                                        ConfigurationManager.AppSettings["FrequencyValue"],
                                        ConfigurationManager.AppSettings["Skip"],
                                        ConfigurationManager.AppSettings["SkipValue"]);

            if (!schedule.IsSingleRun())
            {
                Logger.Info("Start in Scheduled Mode");
                int interval = 1;
                int.TryParse(ConfigurationManager.AppSettings["SchedulerBaseInterval"], out interval);
                Common.Scheduler.TaskScheduler scheduler = new Common.Scheduler.TaskScheduler(interval);
                scheduler.AddTask(StartWebController, schedule);
                scheduler.Start();
                while (Console.Read() != 'q')
                {
                    ;
                }
            }
            else
            {
                Logger.Info("Start in Single Run Mode");
                StartWebController();
                Logger.Info("Checking Finished");
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: birlaakhand/OverWatcher
        public static void Start(string[] args)
        {
            Console.WriteLine("Press \'q\' to quit.");
            BrowserWatcherBase.InitializeEnvironment();
            var schedule = new Schedule(ConfigurationManager.AppSettings["Frequency"],
                                        ConfigurationManager.AppSettings["FrequencyValue"],
                                        ConfigurationManager.AppSettings["Skip"],
                                        ConfigurationManager.AppSettings["SkipValue"]);

            if (!schedule.IsSingleRun())
            {
                Logger.Info("Start in Scheduled Mode");
                int interval = 1;
                int.TryParse(ConfigurationManager.AppSettings["SchedulerBaseInterval"], out interval);
                TaskScheduler scheduler = new TaskScheduler(interval);
                scheduler.AddTask(StartReconsiliation, schedule);
                scheduler.Start();
                while (Console.Read() != 'q')
                {
                    ;
                }
            }
            else
            {
                Logger.Info("Start in Single Run Mode");
                StartReconsiliation();
                Logger.Info("Checking Finished");
            }
        }
コード例 #3
0
 public static void Stop()
 {
     BrowserWatcherBase.CleanupEnvironment();
 }