Exemplo n.º 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();
        }
Exemplo n.º 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();
 }
Exemplo n.º 3
0
 /// <summary>
 /// Start automatic synchronisation after its stop
 /// </summary>
 public static void ContinueAutoSync()
 {
     SyncTimer.Enabled = true;
     SyncInfoGiver.ContinueTimerForUser();
 }
Exemplo n.º 4
0
 /// <summary>
 /// Stop automatic synchronisation
 /// </summary>
 public static void StopAutoSync()
 {
     SyncTimer.Stop();
     SyncInfoGiver.StopTimerForUser();
 }