Event data for a failed step.
Наследование: System.EventArgs
Пример #1
0
        void UpdateStepFailed(UpdateStepOn us, FailArgs args)
        {
            SetLastSuccessfulStep();

            switch (us)
            {
            case UpdateStepOn.Checking:

                if (CheckingFailed != null)
                {
                    CheckingFailed(this, args);
                }

                break;

            case UpdateStepOn.DownloadingUpdate:

                if (DownloadingFailed != null)
                {
                    DownloadingFailed(this, args);
                }

                break;

            case UpdateStepOn.ExtractingUpdate:

                if (ExtractingFailed != null)
                {
                    ExtractingFailed(this, args);
                }

                break;
            }
        }
Пример #2
0
        public frmError(FailArgs failArgs, AUTranslation translation)
        {
            Font = SystemFonts.MessageBoxFont;

            InitializeComponent();

            // Don't show the extended error information textbox if there is no extended error info.
            if (!string.IsNullOrEmpty(failArgs.ErrorMessage))
            {
                richError.Text = failArgs.ErrorMessage;
            }
            else
            {
                richError.Visible = false;
            }

            Text                  = translation.ErrorTitle;
            btnOK.Text            = translation.CloseButton;
            btnTryAgainLater.Text = translation.TryAgainLater;
            lblTitle.Text         = failArgs.ErrorTitle;

            // resize the buttons to fit their contents
            btnTryAgainLater.Left = btnOK.Left - btnTryAgainLater.Width - 6;

            MinimumSize = new Size(richError.Left + Right - btnTryAgainLater.Left, 250);
        }
Пример #3
0
        /// <summary>
        /// Handler method that's called when <see cref="MainForm.AutomaticUpdater"/> reports an error checking for updates.
        /// </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>
        private void AutomaticUpdater_CheckingFailed(object sender, FailArgs e)
        {
            _statusLabel.Text = "Error occurred while checking for updates.  Please try again later.";
            _progressBar.Style = ProgressBarStyle.Continuous;
            _progressBar.Value = 100;

            _okButton.Enabled = true;
        }
Пример #4
0
        public frmError(FailArgs failArgs, AUTranslation translation)
        {
            Font = SystemFonts.MessageBoxFont;

            InitializeComponent();

            richError.Text = failArgs.ErrorMessage;

            Text                  = translation.ErrorTitle;
            btnOK.Text            = translation.CloseButton;
            btnTryAgainLater.Text = translation.TryAgainLater;
            lblTitle.Text         = failArgs.ErrorTitle;

            // resize the buttons to fit their contents
            btnTryAgainLater.Left = btnOK.Left - btnTryAgainLater.Width - 6;

            MinimumSize = new Size(richError.Left + Right - btnTryAgainLater.Left, 250);
        }
Пример #5
0
        void auBackend_ExtractingFailed(object sender, FailArgs e)
        {
            // call this function from ownerForm's thread context
            if (sender != null)
            {
                ownerForm.Invoke(new FailHandler(auBackend_ExtractingFailed), new object[] { null, e });
                return;
            }

            UpdateStepFailed(e);

            Text = translation.FailedToExtract;

            if (DownloadingOrExtractingFailed != null)
            {
                DownloadingOrExtractingFailed(this, e);
            }
        }
Пример #6
0
        public frmError(FailArgs failArgs, AUTranslation translation)
        {
            Font = SystemFonts.MessageBoxFont;

            InitializeComponent();

            richError.Text = failArgs.ErrorMessage;

            Text = translation.ErrorTitle;
            btnOK.Text = translation.CloseButton;
            btnTryAgainLater.Text = translation.TryAgainLater;
            lblTitle.Text = failArgs.ErrorTitle;

            // resize the buttons to fit their contents
            btnTryAgainLater.Left = btnOK.Left - btnTryAgainLater.Width - 6;

            MinimumSize = new Size(richError.Left + Right - btnTryAgainLater.Left, 250);
        }
Пример #7
0
        public frmError(FailArgs failArgs, AUTranslation translation)
        {
            Font = SystemFonts.MessageBoxFont;

            InitializeComponent();

            // Don't show the extended error information textbox if there is no extended error info.
            if (!string.IsNullOrEmpty(failArgs.ErrorMessage))
                richError.Text = failArgs.ErrorMessage;
            else
                richError.Visible = false;

            Text = translation.ErrorTitle;
            btnOK.Text = translation.CloseButton;
            btnTryAgainLater.Text = translation.TryAgainLater;
            lblTitle.Text = failArgs.ErrorTitle;

            // resize the buttons to fit their contents
            btnTryAgainLater.Left = btnOK.Left - btnTryAgainLater.Width - 6;

            MinimumSize = new Size(richError.Left + Right - btnTryAgainLater.Left, 250);
        }
Пример #8
0
        void auBackend_UpdateFailed(object sender, FailArgs e)
        {
            // call this function from ownerForm's thread context
            if (sender != null)
            {
                ownerForm.Invoke(new FailHandler(auBackend_UpdateFailed), new object[] { null, e });
                return;
            }

            // show the control
            Visible = !KeepHidden;

            failArgs = e;

            // show failed Text & icon
            Text = translation.UpdateFailed;
            CreateMenu(MenuType.Error);
            AnimateImage(BmpFailed, true);

            if (UpdateFailed != null)
            {
                UpdateFailed(this, e);
            }
        }
Пример #9
0
        void UpdateStepFailed(FailArgs e)
        {
            if (e.wyUpdatePrematureExit)
            {
                e.ErrorTitle = translation.PrematureExitTitle;

                // use the general "premature exit" message only when there's no other message present
                if (e.ErrorMessage == null || e.ErrorMessage == AUTranslation.C_PrematureExitMessage)
                {
                    e.ErrorMessage = translation.PrematureExitMessage;
                }
            }

            failArgs = e;

            //only show the error if this is visible
            if (Visible)
            {
                CreateMenu(MenuType.Error);
                AnimateImage(BmpFailed, true);
            }

            SetMenuText(translation.CheckForUpdatesMenu);
        }
Пример #10
0
 void OnDownloadingFailed(object sender, FailArgs e)
 {
     Console.WriteLine("download fail");
     UpdateDownloadErrorBox();
 }
Пример #11
0
 private void Updater_CheckingFailed(object sender, FailArgs e)
 {
     Console.WriteLine("*****I FAILED******* " + e.ErrorMessage); // since we kept on getting an error message we added e.ErrorMessage to find out why
     UpdateCheckErrorBox();
 }
Пример #12
0
        void auBackend_UpdateFailed(object sender, FailArgs e)
        {
            // call this function from ownerForm's thread context
            if (sender != null)
            {
                ownerForm.Dispatcher.Invoke(DispatcherPriority.Normal, new FailHandler(auBackend_UpdateFailed), null, e);
                return;
            }

            // show the control
            Visibility = KeepHidden ? Visibility.Hidden : Visibility.Visible;

            failArgs = e;

            // show failed Text & icon
            Text = translation.UpdateFailed;
            CreateMenu(MenuType.Error);
            AnimateImage(Properties.Resources.cross, true);

            if (UpdateFailed != null)
                UpdateFailed(this, e);
        }
Пример #13
0
 void OnExtractingFailed(object sender, FailArgs e)
 {
     Console.WriteLine("extract fail");
     UpdateExtractErrorBox();
 }
Пример #14
0
        void auBackend_ExtractingFailed(object sender, FailArgs e)
        {
            // call this function from ownerForm's thread context
            if (sender != null)
            {
                ownerForm.Dispatcher.Invoke(DispatcherPriority.Normal, new FailHandler(auBackend_ExtractingFailed), null, e);
                return;
            }

            UpdateStepFailed(e);

            Text = translation.FailedToExtract;

            if (DownloadingOrExtractingFailed != null)
                DownloadingOrExtractingFailed(this, e);
        }
Пример #15
0
 void OnFailed(object sender, FailArgs e) //OnUpdateFailed
 {
     Console.WriteLine("fail");
     UpdateErrorBox();
 }
Пример #16
0
        void auBackend_CheckingFailed(object sender, FailArgs e)
        {
            // call this function from ownerForm's thread context
            if (sender != null)
            {
                ownerForm.Invoke(new FailHandler(auBackend_CheckingFailed), new object[] { null, e });
                return;
            }

            UpdateStepFailed(e);

            Text = translation.FailedToCheck;

            if (CheckingFailed != null)
                CheckingFailed(this, e);
        }
Пример #17
0
        void auBackend_UpdateFailed(object sender, FailArgs e)
        {
            if (sender != null)
            {
                // call this function from ownerForm's thread context
                InvokeMyself(new FailHandler(auBackend_UpdateFailed), new object[] {null, e});
                return;
            }

            // show the control
            Visible = !KeepHidden;

            failArgs = e;

            // show failed Text & icon
            Text = translation.UpdateFailed;
            CreateMenu(MenuType.Error);
            AnimateImage(BmpFailed, true);

            if (UpdateFailed != null)
                UpdateFailed(this, e);
        }
Пример #18
0
        void auBackend_ExtractingFailed(object sender, FailArgs e)
        {
            if (sender != null)
            {
                // call this function from ownerForm's thread context
                InvokeMyself(new FailHandler(auBackend_ExtractingFailed), new object[] {null, e});
                return;
            }

            UpdateStepFailed(e);

            Text = translation.FailedToExtract;

            if (DownloadingOrExtractingFailed != null)
                DownloadingOrExtractingFailed(this, e);
        }
Пример #19
0
 private void automaticUpdater_DownloadingOrExtractingFailed(object sender, FailArgs e)
 {
     checkForUpdatesButtonItem.Text = automaticUpdater.Translation.CheckForUpdatesMenu;
 }
Пример #20
0
        void UpdateStepFailed(FailArgs e)
        {
            if (e.wyUpdatePrematureExit)
            {
                e.ErrorTitle = translation.PrematureExitTitle;

                // use the general "premature exit" message only when there's no other message present
                if (e.ErrorMessage == null || e.ErrorMessage == AUTranslation.C_PrematureExitMessage)
                    e.ErrorMessage = translation.PrematureExitMessage;
            }

            failArgs = e;

            //only show the error if this is visible
            if (Visibility == Visibility.Visible)
            {
                CreateMenu(MenuType.Error);
                AnimateImage(Properties.Resources.cross, true);
            }

            SetMenuText(translation.CheckForUpdatesMenu);
        }
        void UpdateStepFailed(UpdateStepOn us, FailArgs args)
        {
            SetLastSuccessfulStep();

            switch (us)
            {
                case UpdateStepOn.Checking:

                    if (CheckingFailed != null)
                        CheckingFailed(this, args);

                    break;
                case UpdateStepOn.DownloadingUpdate:

                    if (DownloadingFailed != null)
                        DownloadingFailed(this, args);

                    break;
                case UpdateStepOn.ExtractingUpdate:

                    if (ExtractingFailed != null)
                        ExtractingFailed(this, args);

                    break;
            }
        }
Пример #22
0
 static void auBackend_UpdateFailed(object sender, FailArgs e)
 {
     //TODO: Notify the admin, or however you want to handle the failure
     WriteToLog("Update failed. Reason\r\nTitle: " + e.ErrorTitle + "\r\nMessage: " + e.ErrorMessage, true);
 }