AdvancedLauncher.UI.Windows.MainWindow.CheckUpdates C# (CSharp) Метод

CheckUpdates() публичный Метод

public CheckUpdates ( ) : void
Результат void
        public void CheckUpdates()
        {
            if (!EnvironmentManager.Settings.CheckForUpdates) {
                return;
            }
            BackgroundWorker updateWorker = new BackgroundWorker();
            updateWorker.DoWork += async (s1, e2) => {
                RemoteVersion remote = RemoteVersion.Instance;
                if (remote != null) {
                    Version currentVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
                    if (remote.Version.CompareTo(currentVersion) > 0) {
                        string content = string.Format(LanguageManager.Model.UpdateAvailableText, remote.Version)
                            + System.Environment.NewLine
                            + System.Environment.NewLine
                            + remote.ChangeLog
                            + System.Environment.NewLine
                            + System.Environment.NewLine
                            + LanguageManager.Model.UpdateDownloadQuestion;
                        string caption = string.Format(LanguageManager.Model.UpdateAvailableCaption, remote.Version);
                        if (await App.Kernel.Get<IDialogManager>().ShowYesNoDialog(caption, content).Wait()) {
                            URLUtils.OpenSite(remote.DownloadUrl);
                        }
                    }
                }
            };
            updateWorker.RunWorkerAsync();
        }