/// <summary>
        /// Shows the exception dialog, which allows the user to choose whether or not to continue.
        /// If the user chooses not to continue, Environment.Exit(1) is called.</summary>
        /// <param name="exception">Exception</param>
        protected virtual void ShowExceptionDialog(Exception exception)
        {
            DialogResult res = DialogResult.None;

            try
            {
                var dlg = new UnhandledExceptionDialog();

                // Call ToString() to get the call stack. The Message property may not include that.
                dlg.ExceptionTextBox.Text = exception.ToString();

                res = dlg.ShowDialog(DialogOwner);

                if (UserFeedbackService != null)
                {
                    UserFeedbackService.ShowFeedbackForm();
                }
            }
            finally
            {
                if (res == DialogResult.No)
                {
                    Environment.Exit(1);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Shows the exception dialog, which allows the user to choose whether or not to continue.
        /// If the user chooses not to continue, Environment.Exit(1) is called.</summary>
        /// <param name="exception">Exception</param>
        protected virtual void ShowExceptionDialog(Exception exception)
        {
            DialogResult res = DialogResult.None;
            try
            {
                var dlg = new UnhandledExceptionDialog();
                
                // Call ToString() to get the call stack. The Message property may not include that.
                dlg.ExceptionTextBox.Text = exception.ToString();

                res = dlg.ShowDialog(DialogOwner);

                if (UserFeedbackService != null)
                    UserFeedbackService.ShowFeedbackForm();
            }
            finally
            {
                if (res == DialogResult.No)
                    Environment.Exit(1);
            }
        }