public static bool Ok(Exception exception, string title, string instruction, string observation = "", bool bugWith4055002 = false) { var dialog = new ExceptionDialog(exception) { BugWithHotFix4055002 = bugWith4055002 }; dialog.PrepareOk(title, instruction, observation); var result = dialog.ShowDialog(); return(result.HasValue && result.Value); }
private void App_OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) { LogWriter.Log(e.Exception, "On Dispacher Unhandled Exception - Unknown"); try { ExceptionDialog.Ok(e.Exception, "ScreenToGif - Translator", "Unhandled exception", e.Exception.Message); } catch (Exception ex) { LogWriter.Log(ex, "Error while displaying the error."); //Ignored. } e.Handled = true; }
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { if (!(e.ExceptionObject is Exception exception)) { return; } LogWriter.Log(exception, "Current Domain Unhandled Exception - Unknown"); try { ExceptionDialog.Ok(exception, "ScreenToGif - Translator", "Unhandled exception", exception.Message); } catch (Exception) { //Ignored. } }