Fixed Issue 26. Added a dialog to automatically send a crash report.

This commit is contained in:
Michael Möller
2010-04-02 16:05:07 +00:00
parent 485c80b04b
commit 20158a0edd
16 changed files with 620 additions and 121 deletions
+26 -23
View File
@@ -36,36 +36,39 @@
*/
using System;
using System.IO;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using OpenHardwareMonitor.GUI;
namespace OpenHardwareMonitor {
static class Program {
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main() {
#if !DEBUG
try {
#endif
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
public static class Program {
using (GUI.MainForm form = new GUI.MainForm()) {
form.FormClosed += delegate(Object sender, FormClosedEventArgs e) {
Application.Exit();
};
Application.Run();
}
[STAThread]
public static void Main() {
#if !DEBUG
} catch (Exception e) {
Utilities.CrashReport.Save(e);
}
AppDomain.CurrentDomain.UnhandledException +=
new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
#endif
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
using (GUI.MainForm form = new GUI.MainForm()) {
form.FormClosed += delegate(Object sender, FormClosedEventArgs e) {
Application.Exit();
};
Application.Run();
}
}
public static void CurrentDomain_UnhandledException(object sender,
UnhandledExceptionEventArgs args)
{
CrashReportForm form = new CrashReportForm();
form.Exception = (Exception)args.ExceptionObject;
form.ShowDialog();
Environment.Exit(0);
}
}
}