public static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
try
{
Exception ex = e.ExceptionObject as Exception;
DialogResult result = MessageBox.Show(Strings_General.BugReportRequest, "Doh!", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
if (result == DialogResult.Yes)
{
ErrorLog log = new ErrorLog(ex);
XmlSerializer serializer = new XmlSerializer(typeof(ErrorLog));
using (TextWriter writer = new StringWriter())
{
serializer.Serialize(writer, log);
PostErrorLog(writer.ToString());
}
}
}
catch (Exception)
{
}
finally
{
Environment.Exit(1);
}
}