示例#1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            MainForm mainForm = new MainForm();

            DataDatabase.InitializeDatabase(mainForm, mainForm.SyncIntervalBox);
            SyncInfoGiver.Initialization(mainForm);
            Synchronization.RunAutoSync();
            Synchronization.SyncNow();
            Application.Run(mainForm);
            DataDatabase.SaveChanges();
        }
示例#2
0
 /// <summary>
 /// Automatic synchronisation
 /// </summary>
 public static void RunAutoSync()
 {
     if (SyncTimer != null)
     {
         SyncTimer.Stop();
         SyncTimer.Dispose();
     }
     lock (DataDatabase.IntervalInMinutesLocker)
         SyncTimer = new System.Timers.Timer((double)(DataDatabase.IntervalInMinutes * 60 * 1000));
     SyncTimer.Elapsed  += Sync;
     SyncTimer.AutoReset = true;
     SyncTimer.Enabled   = true;
     SyncInfoGiver.RunTimerForUser();
 }
示例#3
0
 /// <summary>
 /// Start automatic synchronisation after its stop
 /// </summary>
 public static void ContinueAutoSync()
 {
     SyncTimer.Enabled = true;
     SyncInfoGiver.ContinueTimerForUser();
 }
示例#4
0
 /// <summary>
 /// Stop automatic synchronisation
 /// </summary>
 public static void StopAutoSync()
 {
     SyncTimer.Stop();
     SyncInfoGiver.StopTimerForUser();
 }