Example #1
0
        private void CheckForUpdatesAsync()
        {
            try
            {
                Thread.Sleep(1000);
                var ghc = new GithubConnection();
                var r   = ghc.GetLatestRelease(Settings.UpdateToPrerelease);

                if (r.Item1 > App.APP_VERSION)
                {
                    Application.Current.Dispatcher.BeginInvoke(new Action(() => { UpdateWindow.Show(Owner, this, r.Item1, r.Item2, r.Item3); }));
                }
            }
            catch (Exception e)
            {
                App.Logger.Error("Main", "Updatecheck failed: Can't get latest version from github", e);
            }
        }
        private void ManuallyCheckForUpdates()
        {
            try
            {
                var ghc = new GithubConnection();
                var r   = ghc.GetLatestRelease(Settings.UpdateToPrerelease);

                if (r.Item1 > App.APP_VERSION)
                {
                    UpdateWindow.Show(Owner, this, r.Item1, r.Item2, r.Item3);
                }
                else
                {
                    MessageBox.Show("You are using the latest version");
                }
            }
            catch (Exception e)
            {
                App.Logger.Error("Main", "Can't get latest version from github", e);
                MessageBox.Show("Cannot get latest version from github API");
            }
        }