コード例 #1
0
ファイル: ApplicationForm.cs プロジェクト: melfallas/SILO
 public void enablePeriodSync()
 {
     this.syncTimer.Stop();
     this.syncTimer.Enabled = false;
     if (ParameterService.isPeriodSyncEnabled())
     {
         this.syncTimer.Interval = ParameterService.getPeriodSyncInterval();
         this.syncTimer.Enabled = true;
         this.lastSyncTick = DateTime.Now;
         this.syncTimer.Start();
     }
     else {
         this.timeToSyncLabel.Text = "Sincronización desactivada";
     }
 }
コード例 #2
0
ファイル: ApplicationForm.cs プロジェクト: melfallas/SILO
        private void setTimeToSyncLabel()
        {
            int syncTimerSeconds = (int) this.getSyncTimeSpam().TotalSeconds;
            int timeToSync = ParameterService.getPeriodSyncInterval() / 1000 - syncTimerSeconds;
            if (ParameterService.isPeriodSyncEnabled())
            {
                //this.timeToSyncLabel.Text = syncTimerSeconds == 0 ? "" : "Sincronización en: " +  timeToSync;
                this.timeToSyncLabel.Text = syncTimerSeconds == 0 ? "" : "Sincronización en: " + FormatService.formatSecondsToMinutes(timeToSync);

            }
            else
            {
                this.timeToSyncLabel.Text = "Sincronización desactivada";
            }
        }