Exemple #1
0
        private static void Main(string[] args)
        {
            if (args.Length > 0 && args[0].ToLower().Contains("report"))
            {
                var tableSetData = new TableSetData();
                var tableSets = new List<TableSet>();
                tableSets = tableSetData.LoadTableSets();
                foreach (var tableSet in tableSets)
                {
                    var statusReport = new SyncStatusReport(tableSet);
                    string report = statusReport.GenerateStatusReport();
                    statusReport.SendEmail(report);
                }
            }
            else if (args.Length > 0 && args[0].ToLower().Contains("debug"))
            {
                using (var manager = new SyncManager())
                {
                    manager.DebugMode = true;
                    PerformanceCounters.DebugMode = true;
                    Logging.DebugMode = true;

                    manager.RunTableSets();
                    manager.Start();

                    Console.WriteLine("Hit enter to stop...");
                    Console.ReadLine();
                }
            }
            else
            {
                ServiceBase.Run(new SyncService());
            }
        }
Exemple #2
0
 public SyncManager()
 {
     DebugMode = false;
     var period = Int32.Parse(ConfigurationManager.AppSettings["intervalInSeconds"]);
     timer = new Timer(period*1000);
     timer.Elapsed += timer_Elapsed;
     tableSetData = new TableSetData();
 }
Exemple #3
0
 public SyncManager()
 {
     DebugMode = false;
     var period = Int32.Parse(ConfigurationManager.AppSettings["intervalInSeconds"]);
     timer = new Timer(period*1000);
     timer.Elapsed += timer_Elapsed;
     tableSetData = new TableSetData();
 }