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"; } }
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"; } }