public Task OnVpnStateChanged(VpnStateChangedEventArgs e) { if (!_config.MaintenanceTrackerEnabled) { return(Task.CompletedTask); } _state = e.State; if (e.State.Status == VpnStatus.Connected) { if (!_timer.IsEnabled) { _timer.Interval = _config.MaintenanceCheckInterval; _timer.Start(); } } else { if (_timer.IsEnabled) { _timer.Stop(); } } return(Task.CompletedTask); }
private void StartTimer() { if (!_timer.IsEnabled) { _timer.Start(); } }
public VpnInfoChecker(Common.Configuration.Config appConfig, IEventAggregator eventAggregator, IApiClient api, IUserStorage userStorage, IScheduler scheduler) { eventAggregator.Subscribe(this); _checkInterval = appConfig.VpnInfoCheckInterval.RandomizedWithDeviation(0.2); _api = api; _userStorage = userStorage; _timer = scheduler.Timer(); _timer.Interval = appConfig.ServerUpdateInterval.RandomizedWithDeviation(0.2); _timer.Tick += OnTimerTick; _timer.Start(); }
public void OnUserLoggedIn() { _timer.Start(); }
public void OnUserLoggedIn() { _timer.Interval = _appConfig.AuthCertificateUpdateInterval.RandomizedWithDeviation(0.2); _timer.Start(); }
public void OnUserLoggedIn() { _timer.Start(); _lastVpnProtocol = _appSettings.GetProtocol(); }