void Stop() { _stopwatch.Stop(); _elapsedToken?.Stop(); _elapsedToken = null; DrawStopwatch(); }
private void RegisterHistoryRefresh() { _historyData = new Queue <WeatherStationData>(); RegisterHistoryValue(); _historyTimerToken = _timerService.RegisterTimer(_options.HistoryRefreshSpan, RegisterHistoryValue); _historyTimerToken.Start(); }
public void Stop() { _timerToken?.Stop(); _timerToken = null; SamplesGenerated = 0; SampleReceived?.Invoke(this, null); }
public void Start(String destination) { _destination = destination; if (_timerToken == null) { _timerToken = _timerService.Start(TimeSpan.FromMilliseconds(1000), Do); } }
void RegisterTokenRefresh() { var token = _netatmoClient.CredentialManager.CredentialToken; var expirationTime = token.ExpiresAt.ToDateTimeUtc(); var timeSpan = (expirationTime - DateTime.UtcNow).Add(TimeSpan.FromSeconds(-20)); _netatmoTimerToken = _timerService.RegisterTimer(timeSpan, RefreshToken, true); _netatmoTimerToken.Start(); }
void Start() { var span = _originalSpan - _stopwatch.Elapsed; if (span.TotalMilliseconds > 0) { _stopwatch.Start(); _elapsedToken = GlobalContext.Services.TimerService.RegisterTimer(span, Finish); _elapsedToken.Start(); } }
public void InitContext(GlobalContext context) { _globalContext = context; _timerToken = _globalContext.Services.TimerService.RegisterTimer(new TimeSpan(0, 0, 5, 0), ProcessDraw); }