BF2Statistics.ExceptionForm.ShowDialog C# (CSharp) Метод

ShowDialog() публичный Метод

public ShowDialog ( ) : DialogResult
Результат DialogResult
        public new DialogResult ShowDialog()
        {
            // Append Exception Message
            labelContent.Text = String.Concat(labelContent.Text, Environment.NewLine, Environment.NewLine, ExceptionObj.Message);
            return base.ShowDialog();
        }

Same methods

ExceptionForm::ShowDialog ( IWin32Window owner ) : DialogResult
ExceptionForm::ShowDialog ( bool AppendExceptionMessage ) : DialogResult

Usage Example

        /// <summary>
        /// Handles cross thread exceptions, that are unrecoverable
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public static void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            // Create Trace Log
            string    FileName = GenerateFileName();
            Exception Ex       = e.ExceptionObject as Exception;

            using (ExceptionForm EForm = new ExceptionForm(Ex, false))
            {
                try
                {
                    // Try to generate a trace log
                    GenerateExceptionLog(FileName, Ex);

                    // Display the Exception Form
                    EForm.Message = "An unhandled exception was thrown while trying to preform the requested task.\r\n"
                                    + "A trace log was generated under the \"My Documents/BF2Stastistics\" folder, to "
                                    + "assist with debugging, and getting help with this error.";
                    EForm.TraceLog = FileName;
                }
                catch
                {
                    EForm.Message = "An unhandled exception was thrown while trying to preform the requested task.\r\n"
                                    + "A trace log was unable to be generated because that threw another exception :(. The error message "
                                    + "for the trace log was stored in the program error log for debugging purposes.";
                }
                finally
                {
                    EForm.ShowDialog();
                    Application.Exit();
                }
            }
        }
All Usage Examples Of BF2Statistics.ExceptionForm::ShowDialog