Beispiel #1
0
        private void CreateCommands()
        {
            LoadConfigCmd = R2Command.Relay(LoadConfig,
                                            x => !IsChecking, "Load Config");

            StartCheckingCmd = R2Command.Relay(
                () => _upd8r.StartCheckingForUpdates
                    (TimeSpan.FromSeconds(SecondsInterval)),
                x => !IsChecking, "Start Checking");

            StopCheckingCmd = R2Command.Relay(_upd8r.StopCheckingForUpdates,
                                              x => IsChecking, "Stop Checking");
        }
Beispiel #2
0
        public void StartCheckingForUpdates(int?overrideIntervalSeconds = null)
        {
            if (_r2Upd8r.IsChecking)
            {
                return;
            }

            var creds = GetCredentials();

            if (creds == null)
            {
                return;
            }

            _r2Upd8r.SetCredentials(creds);

            var seconds  = overrideIntervalSeconds ?? creds.CheckIntervalSeconds;
            var interval = TimeSpan.FromSeconds(seconds);

            _r2Upd8r.StartCheckingForUpdates(interval);
        }