//Report Bug protected override void reportBugExecute() { string reportPrompt = "Please describe the bug and how to reproduce it."; string logDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "EstimateBuilder\\logs"); string logPath = UtilitiesMethods.GetMostRecentFilePathFromDirectoryPath(logDirectory); BugReportWindow reportWindow = new BugReportWindow("Estimate Builder Bug", reportPrompt, logPath); reportWindow.ShowDialog(); }
private void ReportCrash(Exception ex) { ReportCrash(ex.ToString()); Dispatcher.InvokeAsync(() => { BugReportWindow window = new BugReportWindow(); window.Owner = this; window.Fill(ex); window.ShowDialog(); }); }
private void logUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) { logger.Fatal("Unhandled exception: {0}", e.Exception.Message); logger.Fatal("Inner exception: {0}", e.Exception.InnerException.Message); logger.Fatal("Stack trace: {0}", e.Exception.StackTrace); string reportPrompt = "A crash has occured. Please describe to the best of your ability the actions leading up to the crash."; string logDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TemplateBuilder\\logs"); string logPath = UtilitiesMethods.GetMostRecentFilePathFromDirectoryPath(logDirectory); BugReportWindow reportWindow = new BugReportWindow("Template Builder Crash", reportPrompt, logPath); reportWindow.ShowDialog(); //MessageBox.Show("Fatal error occured, view logs for more information.", "Fatal Error!", MessageBoxButton.OK, MessageBoxImage.Error); System.Environment.Exit(0); }