Exemplo n.º 1
0
 void Stop()
 {
     _stopwatch.Stop();
     _elapsedToken?.Stop();
     _elapsedToken = null;
     DrawStopwatch();
 }
Exemplo n.º 2
0
 private void RegisterHistoryRefresh()
 {
     _historyData = new Queue <WeatherStationData>();
     RegisterHistoryValue();
     _historyTimerToken = _timerService.RegisterTimer(_options.HistoryRefreshSpan, RegisterHistoryValue);
     _historyTimerToken.Start();
 }
Exemplo n.º 3
0
 public void Stop()
 {
     _timerToken?.Stop();
     _timerToken      = null;
     SamplesGenerated = 0;
     SampleReceived?.Invoke(this, null);
 }
Exemplo n.º 4
0
 public void Start(String destination)
 {
     _destination = destination;
     if (_timerToken == null)
     {
         _timerToken = _timerService.Start(TimeSpan.FromMilliseconds(1000), Do);
     }
 }
Exemplo n.º 5
0
        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();
        }
Exemplo n.º 6
0
        void Start()
        {
            var span = _originalSpan - _stopwatch.Elapsed;

            if (span.TotalMilliseconds > 0)
            {
                _stopwatch.Start();
                _elapsedToken = GlobalContext.Services.TimerService.RegisterTimer(span, Finish);
                _elapsedToken.Start();
            }
        }
Exemplo n.º 7
0
 public void InitContext(GlobalContext context)
 {
     _globalContext = context;
     _timerToken    = _globalContext.Services.TimerService.RegisterTimer(new TimeSpan(0, 0, 5, 0), ProcessDraw);
 }