public static SUUpdateAlert CreateAlert(SUHost host, SUAppcastItem item)
        {
            SUUpdateAlertWindow window = new SUUpdateAlertWindow();
            SUUpdateAlert       alert  = new SUUpdateAlert(window, host, item);

            return(alert);
        }
        public void UpdateAlertMadeChoice(SUUpdateAlert anAlert, SUUpdateAlertChoice choice, bool shouldCloseWindowIfNeeded)
        {
            Host.SetObjectForUserDefaultsKey(null, SUConstants.SUSkippedVersionKey);

            switch (choice) {
                case SUUpdateAlertChoice.SUInstallUpdateChoice:

                    // Download!
                    anAlert.SwitchToDownloadAction();
                    DownloadUpdate();

                    break;

                case SUUpdateAlertChoice.SUSkipThisVersionChoice:

                    Host.SetObjectForUserDefaultsKey(updateItem.VersionString, SUConstants.SUSkippedVersionKey);
                    anAlert.Delegate = null;
                    if (shouldCloseWindowIfNeeded) { anAlert.Window.Close(); }
                    alert = null;

                    AbortUpdate();
                    break;

                case SUUpdateAlertChoice.SURemindMeLaterChoice:

                    anAlert.Delegate = null;
                    if (shouldCloseWindowIfNeeded) { anAlert.Window.Close(); }
                    alert = null;

                    AbortUpdate();
                    break;
            }
        }
 public void CancelDownload(SUUpdateAlert alert)
 {
     if (download != null)
     {
         download.CancelAsync();
     }
 }
        protected override void DidFindValidUpdate() {
            
            if (Updater.Delegate != null) {
                Updater.Delegate.UpdaterDidFindValidUpdate(Updater, updateItem);
            }

            alert = SUUpdateAlert.CreateAlert(Host, updateItem);
            alert.Delegate = this;
            alert.ShowWindow();

        }
        protected override void DidFindValidUpdate()
        {
            if (Updater.Delegate != null)
            {
                Updater.Delegate.UpdaterDidFindValidUpdate(Updater, updateItem);
            }

            alert          = SUUpdateAlert.CreateAlert(Host, updateItem);
            alert.Delegate = this;
            alert.ShowWindow();
        }
        public void UpdateAlertMadeChoice(SUUpdateAlert anAlert, SUUpdateAlertChoice choice, bool shouldCloseWindowIfNeeded)
        {
            Host.SetObjectForUserDefaultsKey(null, SUConstants.SUSkippedVersionKey);

            switch (choice)
            {
            case SUUpdateAlertChoice.SUInstallUpdateChoice:

                // Download!
                anAlert.SwitchToDownloadAction();
                DownloadUpdate();

                break;

            case SUUpdateAlertChoice.SUSkipThisVersionChoice:

                Host.SetObjectForUserDefaultsKey(updateItem.VersionString, SUConstants.SUSkippedVersionKey);
                anAlert.Delegate = null;
                if (shouldCloseWindowIfNeeded)
                {
                    anAlert.Window.Close();
                }
                alert = null;

                AbortUpdate();
                break;

            case SUUpdateAlertChoice.SURemindMeLaterChoice:

                anAlert.Delegate = null;
                if (shouldCloseWindowIfNeeded)
                {
                    anAlert.Window.Close();
                }
                alert = null;

                AbortUpdate();
                break;
            }
        }
Beispiel #7
0
 public static SUUpdateAlert CreateAlert(SUHost host, SUAppcastItem item)
 {
     SUUpdateAlertWindow window = new SUUpdateAlertWindow();
     SUUpdateAlert alert = new SUUpdateAlert(window, host, item);
     return alert;
 }
 public void UpdateWindowClosed(SUUpdateAlert alert) {
     AbortUpdate();
 }
 public void InstallUpdate(SUUpdateAlert alert) {
     InstallUpdate();
 }
 public void UpdateWindowClosed(SUUpdateAlert alert)
 {
     AbortUpdate();
 }
 public void InstallUpdate(SUUpdateAlert alert)
 {
     InstallUpdate();
 }
 public void CancelDownload(SUUpdateAlert alert)
 {
     if (download != null) {
         download.CancelAsync();
     }
 }