예제 #1
0
        private void HandleUpdateAvailableInternal(UpdateAvailableEventArgs args)
        {
            Helpers.AssertOnUiThread();

            downloadUpdate.Text      += $" ({args.Version})";
            downloadUpdate.Visible    = true;
            downloadSeparator.Visible = true;

            if (args.Version.Important &&
                (ConfigManager.Config.Notifications.Types.UpdateAvailable ||
                 ConfigManager.Config.Notifications.Types.ImportantUpdateAvailable))
            {
                Raise($"An important vulnerability fix ({args.Version}) is available. Check the release for more information.", Severity.Info);
            }
            else if (ConfigManager.Config.Notifications.Types.UpdateAvailable)
            {
                if (args.Version.IsPrerelease)
                {
                    Raise($"A new pre-release ({args.Version}) is available.", Severity.Info);
                }
                else
                {
                    Raise($"A new update ({args.Version}) is available.", Severity.Info);
                }
            }
        }
예제 #2
0
 void UpdateAvailableCallback(object sender, UpdateAvailableEventArgs e)
 {
     Updater.Instance.UpdateAvailable -= UpdateAvailableCallback;
     NetworkManager.Instance.Notify(src, "Update available.");
     NetworkManager.Instance.Notify(src, "[CurVer] {0}", e.currentVersion);
     NetworkManager.Instance.Notify(src, "[NewVer] {0}", e.newVersion);
 }
예제 #3
0
        private void NewVersionAvailableHandler(object sender, UpdateAvailableEventArgs e)
        {
            this.Package           = e.UpdatePackage;
            this.IsUpdateAvailable = true;

            this.destinationPath = e.UpdatePackageLocation;
            RaisePropertyChanged(nameof(this.ShowInstallUpdateButton));

            if (!string.IsNullOrEmpty(destinationPath))
            {
                this.UpdateToolTip = ResourceUtils.GetString("Language_Click_Here_To_Install");
            }
            else
            {
                this.UpdateToolTip = ResourceUtils.GetString("Language_Click_Here_To_Download");
            }
        }
예제 #4
0
        private void HandleUpdateAvailable(object sender, UpdateAvailableEventArgs args)
        {
            if (System.Windows.Application.Current.Dispatcher.CheckAccess())
            {
                var notification = Notification.Create(
                    Notification.Types.UpdateAvailable,
                    Resources.Updater_Notification_Title,
                    string.Format(Resources.Updater_Notification_NewAppVersion, args.Version),
                    () => Process.Start(KanColleClient.Current.Updater.GetDownloadUrl()));

                this.Notify(notification);
            }
            else
            {
                System.Windows.Application.Current.Dispatcher.BeginInvoke(new System.Action(() => this.HandleUpdateAvailable(sender, args)), DispatcherPriority.Normal);
            }
        }
예제 #5
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public UpdateNotifyForm(UpdateAvailableEventArgs args)
     : this()
 {
     m_args = args;
 }
예제 #6
0
        /// <summary>
        /// Occurs when a program update is available. Display the information form to the user.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void OnUpdateAvailable(object sender, UpdateAvailableEventArgs e)
        {
            // Notify the user and prompt him
            if (m_isShowingUpdateWindow)
                return;

            m_isShowingUpdateWindow = true;

            // New release of the same major version available
            if (!String.IsNullOrWhiteSpace(e.UpdateMessage))
            {
                using (UpdateNotifyForm form = new UpdateNotifyForm(e))
                {
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        m_isUpdating = true;

                        // Save the settings to make sure we don't lose anything
                        await Settings.SaveImmediateAsync();
                        Close();
                    }
                }
            }
            // new major version release
            else
            {
                string message = $"A new version ({e.NewestVersion}) is available at {NetworkConstants.EVEMonMainPage}." +
                                 $"{Environment.NewLine}{Environment.NewLine}" +
                                 $"Your current version is: {e.CurrentVersion}.";

                MessageBoxCustom.Show(this, message, @"EVEMon Update Available", "Ignore this upgrade",
                    icon: MessageBoxIcon.Information);

                if (MessageBoxCustom.CheckBoxChecked)
                    Settings.Updates.MostRecentDeniedMajorUpgrade = e.NewestVersion.ToString();
            }

            m_isShowingUpdateWindow = false;
            m_isUpdating = false;
        }
예제 #7
0
 void UpdateAvailableCallback(object sender, UpdateAvailableEventArgs e)
 {
     Updater.Instance.UpdateAvailable -= UpdateAvailableCallback;
     Updater.Instance.DownloadUpdate(args.First());
 }
예제 #8
0
 public void HandleUpdateAvailable(UpdateAvailableEventArgs args)
 {
     Application.Current.Dispatcher.Invoke(() => HandleUpdateAvailableInternal(args));
 }
예제 #9
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public UpdateNotifyForm(UpdateAvailableEventArgs args)
     : this()
 {
     m_args = args;
 }
 protected virtual void OnRaiseUpdateAvailable(UpdateAvailableEventArgs e)
 {
     UpdateAvailable?.Invoke(this, e);
 }