public static void Show(Exception ex) { ApplicationException appEx = GetInnerApplicationException(ex); if (appEx != null) { MessageBox.Show(null, appEx.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { using (ErrorBox errorBox = new ErrorBox()) { errorBox._error = ex.Message; errorBox._detailedError = ex.ToString(); errorBox.Text = "Error"; errorBox.ShowDialog(); } } }
static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e) { ErrorBox.Show(e.Exception); }
public static void Show( Exception ex ) { ApplicationException appEx = GetInnerApplicationException( ex ); if( appEx != null ) { MessageBox.Show(null, appEx.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { using( ErrorBox errorBox = new ErrorBox() ) { errorBox._error = ex.Message; errorBox._detailedError = ex.ToString(); errorBox.Text = "Error"; errorBox.ShowDialog(); } } }
public static void Show( string error, string text, string detailedError ) { using( ErrorBox errorBox = new ErrorBox() ) { errorBox._error = error; errorBox._detailedError = detailedError; errorBox.Text = text; errorBox.ShowDialog(); } }