예제 #1
0
 private void InitUpdateChecker()
 {
     WindowsAPIAdapter.HotKeyPressed += HandleHotkeyPress;
     _updateChecker = new IntervalUpdateChecker(
         new Uri("https://api.github.com/repos/Belphemur/SoundSwitch/releases"),
         AppConfigs.Configuration.UpdateCheckInterval, AppConfigs.Configuration.SubscribedBetaVersion);
     _updateChecker.UpdateAvailable += (sender, @event) => NewVersionReleased?.Invoke(this, @event);
     _updateChecker.CheckForUpdate();
 }
예제 #2
0
        private void InitUpdateChecker()
        {
            WindowsAPIAdapter.HotKeyPressed += HandleHotkeyPress;
#if DEBUG
            const string url = "https://www.aaflalo.me/api.json";
#else
            const string url = "https://api.github.com/repos/Belphemur/SoundSwitch/releases";
#endif
            _updateChecker = new IntervalUpdateChecker(
                new Uri(url),
                AppConfigs.Configuration.UpdateCheckInterval, AppConfigs.Configuration.SubscribedBetaVersion);
            _updateChecker.UpdateAvailable += (sender, @event) => NewVersionReleased?.Invoke(this,
                                                                                             new NewReleaseAvailableEvent(@event.Release, AppConfigs.Configuration.UpdateState));
            _updateChecker.CheckForUpdate();
        }
예제 #3
0
        private void InitUpdateChecker()
        {
            if (AppConfigs.Configuration.UpdateMode == UpdateMode.Never)
            {
                return;
            }
#if DEBUG
            const string url = "https://www.aaflalo.me/api.json";
#else
            const string url = "https://api.github.com/repos/Belphemur/SoundSwitch/releases";
#endif
            _updateChecker = new IntervalUpdateChecker(new Uri(url),
                                                       AppConfigs.Configuration.UpdateCheckInterval,
                                                       AppConfigs.Configuration.IncludeBetaVersions);

            _updateChecker.UpdateAvailable += (sender, @event) => NewVersionReleased?.Invoke(this,
                                                                                             new NewReleaseAvailableEvent(@event.Release, AppConfigs.Configuration.UpdateMode));
            _updateChecker.CheckForUpdate();
        }