Exemple #1
0
        private static void Display(string title, string useful_text_heading, string useful_text_subheading, string comments_label, bool display_exception_section, bool display_faq_link, Exception ex)
        {
            try
            {
                Logging.Info(string.Format("About to display client stats: {0}", useful_text_heading), ex);

                if (!ShutdownableManager.Instance.IsShuttingDown)
                {
                    WPFDoEvents.InvokeInUIThread(() =>
                    {
                        UnhandledExceptionMessageBox mb = new UnhandledExceptionMessageBox();
                        mb.Title = title;
                        mb.PopulateText(useful_text_heading, useful_text_subheading, comments_label, display_faq_link);
                        mb.PopulateException(ex, display_exception_section);
                        mb.PopulateLog();
                        mb.PopulateMachineStats();
                        mb.ShowDialog();
                    });
                }
                else
                {
                    throw new Exception(String.Format("Unhandled Exception Display while shutting down:\nHeading: {0}\nOriginal Exception: {1}", useful_text_heading, ex), ex);
                }
            }
            catch (Exception ex2)
            {
                Logging.Error(ex2, "There was an error while trying to display an UnhandledExceptionMessageBox.  Bailing so that we don't get an infinite-recurse!");
            }
        }
        private static void Display(string title, string useful_text_heading, string useful_text_subheading, string comments_label, bool display_exception_section, bool display_faq_link, Exception ex)
        {
            try
            {
                Logging.Info(string.Format("About to display client stats: {0}", useful_text_heading), ex);

                UnhandledExceptionMessageBox mb = new UnhandledExceptionMessageBox();
                mb.Title = title;
                mb.PopulateText(useful_text_heading, useful_text_subheading, comments_label, display_faq_link);
                mb.PopulateException(ex, display_exception_section);
                mb.PopulateLog();
                mb.PopulateMachineStats();
                mb.ShowDialog();
            }

            catch (Exception ex2)
            {
                Logging.Error(ex2, "There was an error while trying to display an UnhandledExceptionMessageBox.  Bailing so that we don't get an infinite-recurse!");
            }
        }