コード例 #1
0
        private string GetExceptionInfo(Exception ex)
        {
            StringBuilder sb     = new StringBuilder();
            StringWriter  writer = new StringWriter(sb);

            AppTextExceptionFormatter formatter = new AppTextExceptionFormatter(writer, ex);

            // Format the exception
            formatter.Format();

            return(sb.ToString());
        }
コード例 #2
0
        // Creates the error message and displays it.
        private DialogResult ShowThreadExceptionDialog(Exception ex)
        {
            string errorMsg = "The following exception was caught by the Quick Start Global Exception Handler:" + Environment.NewLine + Environment.NewLine;

            StringBuilder sb = new StringBuilder();
            StringWriter writer = new StringWriter(sb);

            AppTextExceptionFormatter formatter = new AppTextExceptionFormatter(writer, ex);

            // Format the exception
            formatter.Format();

            errorMsg +=  sb.ToString();

            return MessageBox.Show(errorMsg, "Application Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
        }
コード例 #3
0
        // Creates the error message and displays it.
        private DialogResult ShowThreadExceptionDialog(Exception ex)
        {
            string errorMsg = "The following exception was caught by the Quick Start Global Exception Handler:" + Environment.NewLine + Environment.NewLine;

            StringBuilder sb     = new StringBuilder();
            StringWriter  writer = new StringWriter(sb);

            AppTextExceptionFormatter formatter = new AppTextExceptionFormatter(writer, ex);

            // Format the exception
            formatter.Format();

            errorMsg += sb.ToString();

            return(MessageBox.Show(errorMsg, "Application Error", MessageBoxButtons.OK, MessageBoxIcon.Stop));
        }
コード例 #4
0
        private string GetExceptionInfo(Exception ex)
        {
            StringBuilder sb = new StringBuilder();
            StringWriter writer = new StringWriter(sb);

            AppTextExceptionFormatter formatter = new AppTextExceptionFormatter(writer, ex);

            // Format the exception
            formatter.Format();

            return sb.ToString();
        }