Exemplo n.º 1
0
        public void Process()
        {
            //System.Timers.Timer timer = new System.Timers.Timer();
            //timer.Interval = interval * 1000;
            //timer.Elapsed += new System.Timers.ElapsedEventHandler(this.OnTimer);
            //timer.Start();

            var syncManager = new SyncManager(sourcePath, targetPath, SyncOptions.OneWay, logger);
            while (true)
            {
                syncManager.Start();
                Thread.Sleep(interval * 1000);
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            string sourcePath = ConfigurationManager.AppSettings["source"];
            string targetPath = ConfigurationManager.AppSettings["target"];
            string intervalValue = ConfigurationManager.AppSettings["interval"];
            int interval;

            int.TryParse(intervalValue, out interval);
            if (interval == 0)
            {
                interval = 20;
            }
            log4net.Config.XmlConfigurator.Configure();
            logger = new Logger("SyncService");
            var syncManager = new SyncManager(sourcePath, targetPath, SyncOptions.Both, logger);

            while (true)
            {
                syncManager.Start();
                Thread.Sleep(interval * 1000);
            }
        }
Exemplo n.º 3
0
 public void OnTimer(object sender, System.Timers.ElapsedEventArgs args)
 {
     var syncManager = new SyncManager(sourcePath, targetPath, SyncOptions.OneWay, logger);
     syncManager.Start();
 }