Event data for before an update step is processed.
Inheritance: System.EventArgs
Ejemplo n.º 1
0
        void InstallPendingUpdate()
        {
            BeforeArgs bArgs = new BeforeArgs();

            if (BeforeInstalling != null)
            {
                BeforeInstalling(this, bArgs);
            }

            // if the update is cancelled postpone the update until later
            if (bArgs.Cancel)
            {
                if (ClosingForInstall && ClosingAborted != null)
                {
                    ClosingAborted(this, EventArgs.Empty);
                    ClosingForInstall = false;
                }
                return;
            }

            // send the client the arguments that need to run on success and failure
            if (ServiceName != null)
            {
                updateHelper.RestartInfo(ServiceName, AutoUpdaterInfo.AutoUpdateID, Arguments, true);
            }
            else
            {
                updateHelper.RestartInfo(Application.ExecutablePath, AutoUpdaterInfo.AutoUpdateID, Arguments, false);
            }
        }
Ejemplo n.º 2
0
        void auBackend_BeforeChecking(object sender, BeforeArgs e)
        {
            // disable any scheduled checking
            tmrWaitBeforeCheck.Enabled = false;

            SetMenuText(translation.CancelCheckingMenu);

            if (BeforeChecking != null)
            {
                BeforeChecking(this, e);
            }

            if (e.Cancel)
            {
                // close wyUpdate
                auBackend.Cancel();
                return;
            }

            // show the working animation
            SetUpdateStepOn(UpdateStepOn.Checking);
            UpdateProcessing(false);

            // setup the context menu
            CreateMenu(MenuType.CheckingMenu);
        }
Ejemplo n.º 3
0
        void auBackend_BeforeDownloading(object sender, BeforeArgs e)
        {
            // call this function from ownerForm's thread context
            if (sender != null)
            {
                ownerForm.Invoke(new BeforeHandler(auBackend_BeforeDownloading), new object[] { null, e });
                return;
            }

            if (BeforeDownloading != null)
            {
                BeforeDownloading(this, e);
            }

            if (e.Cancel)
            {
                return;
            }

            SetMenuText(translation.CancelUpdatingMenu);

            // if the control is hidden show it now (so the user can cancel the downloading if they want)
            // show the 'working' animation
            SetUpdateStepOn(UpdateStepOn.DownloadingUpdate);
            UpdateProcessing(true);

            CreateMenu(MenuType.CancelDownloading);
        }
Ejemplo n.º 4
0
        void auBackend_BeforeExtracting(object sender, BeforeArgs e)
        {
            // call this function from ownerForm's thread context
            if (sender != null)
            {
                ownerForm.Invoke(new BeforeHandler(auBackend_BeforeExtracting), new object[] { null, e });
                return;
            }

            SetUpdateStepOn(UpdateStepOn.ExtractingUpdate);

            CreateMenu(MenuType.CancelExtracting);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Check for updates forcefully -- returns true if the updating has begun. Use the "CheckingFailed", "UpdateAvailable", or "UpToDate" events for the result.
        /// </summary>
        /// <param name="recheck">Recheck with the servers regardless of cached updates, etc.</param>
        /// <returns>Returns true if checking has begun, false otherwise.</returns>
        public bool ForceCheckForUpdate(bool recheck)
        {
            if (AutoUpdaterInfo == null)
            {
                throw new FailedToInitializeException();
            }

            // if not already checking for updates then begin checking.
            if (UpdateStepOn == UpdateStepOn.Nothing || (recheck && UpdateStepOn == UpdateStepOn.UpdateAvailable))
            {
                BeforeArgs bArgs = new BeforeArgs();

                if (BeforeChecking != null)
                {
                    BeforeChecking(this, bArgs);
                }

                if (bArgs.Cancel)
                {
                    // close wyUpdate
                    updateHelper.Cancel();
                    return(false);
                }

                // show the working animation
                UpdateStepOn = UpdateStepOn.Checking;

                if (recheck)
                {
                    updateHelper.ForceRecheckForUpdate();
                }
                else
                {
                    updateHelper.CheckForUpdate();
                }

                return(true);
            }

            return(false);
        }
Ejemplo n.º 6
0
        void ExtractUpdate()
        {
            BeforeArgs bArgs = new BeforeArgs();

            if (BeforeExtracting != null)
            {
                BeforeExtracting(this, bArgs);
            }

            if (bArgs.Cancel)
            {
                // close wyUpdate
                updateHelper.Cancel();
                return;
            }

            UpdateStepOn = UpdateStepOn.ExtractingUpdate;

            // extract the update
            updateHelper.BeginExtraction();
        }
Ejemplo n.º 7
0
        void DownloadUpdate()
        {
            BeforeArgs bArgs = new BeforeArgs();

            if (BeforeDownloading != null)
            {
                BeforeDownloading(this, bArgs);
            }

            if (bArgs.Cancel)
            {
                // close wyUpdate
                updateHelper.Cancel();
                return;
            }

            // if the control is hidden show it now (so the user can cancel the downloading if they want)
            // show the 'working' animation
            UpdateStepOn = UpdateStepOn.DownloadingUpdate;

            updateHelper.DownloadUpdate();
        }
Ejemplo n.º 8
0
        void auBackend_BeforeInstalling(object sender, BeforeArgs e)
        {
            if (sender != null)
            {
                // call this function from ownerForm's thread context
                InvokeMyself(new BeforeHandler(auBackend_BeforeInstalling), new object[] {null, e});
                return;
            }

            if (BeforeInstalling != null)
                BeforeInstalling(this, e);
        }
        void DownloadUpdate()
        {
            BeforeArgs bArgs = new BeforeArgs();

            if (BeforeDownloading != null)
                BeforeDownloading(this, bArgs);

            if (bArgs.Cancel)
            {
                // close wyUpdate
                updateHelper.Cancel();
                return;
            }

            // if the control is hidden show it now (so the user can cancel the downloading if they want)
            // show the 'working' animation
            UpdateStepOn = UpdateStepOn.DownloadingUpdate;

            updateHelper.DownloadUpdate();
        }
Ejemplo n.º 10
0
        void auBackend_BeforeInstalling(object sender, BeforeArgs e)
        {
            // call this function from ownerForm's thread context
            if (sender != null)
            {
                ownerForm.Dispatcher.Invoke(DispatcherPriority.Normal, new BeforeHandler(auBackend_BeforeInstalling), null, e);
                return;
            }

            if (BeforeInstalling != null)
                BeforeInstalling(this, e);
        }
Ejemplo n.º 11
0
        void auBackend_BeforeExtracting(object sender, BeforeArgs e)
        {
            // call this function from ownerForm's thread context
            if (sender != null)
            {
                ownerForm.Dispatcher.Invoke(DispatcherPriority.Normal, new BeforeHandler(auBackend_BeforeExtracting), null, e);
                return;
            }

            SetUpdateStepOn(UpdateStepOn.ExtractingUpdate);

            CreateMenu(MenuType.CancelExtracting);
        }
Ejemplo n.º 12
0
        void auBackend_BeforeDownloading(object sender, BeforeArgs e)
        {
            // call this function from ownerForm's thread context
            if (sender != null)
            {
                ownerForm.Dispatcher.Invoke(DispatcherPriority.Normal, new BeforeHandler(auBackend_BeforeDownloading), null, e);
                return;
            }

            if (BeforeDownloading != null)
                BeforeDownloading(this, e);

            if (e.Cancel)
                return;

            SetMenuText(translation.CancelUpdatingMenu);

            // if the control is hidden show it now (so the user can cancel the downloading if they want)
            // show the 'working' animation
            SetUpdateStepOn(UpdateStepOn.DownloadingUpdate);
            UpdateProcessing(true);

            CreateMenu(MenuType.CancelDownloading);
        }
Ejemplo n.º 13
0
        void auBackend_BeforeChecking(object sender, BeforeArgs e)
        {
            // disable any scheduled checking
            tmrWaitBeforeCheck.Enabled = false;

            SetMenuText(translation.CancelCheckingMenu);

            if (BeforeChecking != null)
                BeforeChecking(this, e);

            if (e.Cancel)
            {
                // close wyUpdate
                auBackend.Cancel();
                return;
            }

            // show the working animation
            SetUpdateStepOn(UpdateStepOn.Checking);
            UpdateProcessing(false);

            // setup the context menu
            CreateMenu(MenuType.CheckingMenu);
        }
Ejemplo n.º 14
0
 private void automaticUpdater_BeforeDownloading(object sender, BeforeArgs e)
 {
     checkForUpdatesButtonItem.Text = automaticUpdater.Translation.CancelUpdatingMenu;
 }
        void InstallPendingUpdate()
        {
            BeforeArgs bArgs = new BeforeArgs();

            if (BeforeInstalling != null)
                BeforeInstalling(this, bArgs);

            // if the update is cancelled postpone the update until later
            if (bArgs.Cancel)
            {
                if (ClosingForInstall && ClosingAborted != null)
                {
                    ClosingAborted(this, EventArgs.Empty);
                    ClosingForInstall = false;
                }
                return;
            }

            // send the client the arguments that need to run on success and failure
            if (ServiceName != null)
                updateHelper.RestartInfo(ServiceName, AutoUpdaterInfo.AutoUpdateID, Arguments, true);
            else
                updateHelper.RestartInfo(Application.ExecutablePath, AutoUpdaterInfo.AutoUpdateID, Arguments, false);
        }
        /// <summary>
        /// Check for updates forcefully.
        /// </summary>
        /// <param name="recheck">Recheck with the servers regardless of cached updates, etc.</param>
        /// <returns>Returns true if checking has begun, false otherwise.</returns>
        public bool ForceCheckForUpdate(bool recheck)
        {
            if (AutoUpdaterInfo == null)
                throw new FailedToInitializeException();

            // if not already checking for updates then begin checking.
            if (UpdateStepOn == UpdateStepOn.Nothing || (recheck && UpdateStepOn == UpdateStepOn.UpdateAvailable))
            {
                BeforeArgs bArgs = new BeforeArgs();

                if (BeforeChecking != null)
                    BeforeChecking(this, bArgs);

                if (bArgs.Cancel)
                {
                    // close wyUpdate
                    updateHelper.Cancel();
                    return false;
                }

                // show the working animation
                UpdateStepOn = UpdateStepOn.Checking;

                if (recheck)
                    updateHelper.ForceRecheckForUpdate();
                else
                    updateHelper.CheckForUpdate();

                return true;
            }

            return false;
        }
Ejemplo n.º 17
0
 /// <summary>
 /// Handler method that's called when <see cref="MainForm.AutomaticUpdater"/> starts downloading an update.
 /// </summary>
 /// <param name="sender">Object from which this event originated, <see cref="MainForm.AutomaticUpdater"/> in this case.</param>
 /// <param name="e">Arguments associated with this event.</param>
 void AutomaticUpdater_BeforeDownloading(object sender, BeforeArgs e)
 {
     _statusLabel.Text = "Downloading updates...";
 }
        void ExtractUpdate()
        {
            BeforeArgs bArgs = new BeforeArgs();

            if (BeforeExtracting != null)
                BeforeExtracting(this, bArgs);

            if (bArgs.Cancel)
            {
                // close wyUpdate
                updateHelper.Cancel();
                return;
            }

            UpdateStepOn = UpdateStepOn.ExtractingUpdate;

            // extract the update
            updateHelper.BeginExtraction();
        }
Ejemplo n.º 19
0
        void auBackend_BeforeExtracting(object sender, BeforeArgs e)
        {
            if (sender != null)
            {
                // call this function from ownerForm's thread context
                InvokeMyself(new BeforeHandler(auBackend_BeforeExtracting), new object[] {null, e});
                return;
            }

            SetUpdateStepOn(UpdateStepOn.ExtractingUpdate);

            CreateMenu(MenuType.CancelExtracting);
        }