diff FrmMainWindow.cs @ 57:293d204e40db

Re #60: Add UI to add/remove/edit weapons in GTK * Make enabling/disabling fit the values passed (copied from existing WinForms checks) * Add extra interface methods and properties to get necessary values from UI to use in command * Implement new interface methods * Implement command execution * Make use of IDisposable interface instead of defining Dispose ourselves Also: * Use existing method of printing exception stack traces in main window
author IBBoard <dev@ibboard.co.uk>
date Thu, 26 Aug 2010 19:30:22 +0000
parents 4bad8cb3f889
children e3fe48c4d794
line wrap: on
line diff
--- a/FrmMainWindow.cs	Wed Aug 25 20:04:27 2010 +0000
+++ b/FrmMainWindow.cs	Thu Aug 26 19:30:22 2010 +0000
@@ -90,9 +90,10 @@
 
 		private static void HandleUnhandledException(Exception ex)
 		{
-			LogManager.GetLogger(typeof(FrmMainWindow)).FatalFormat("({0}) {1} {2} {3}", ex.GetType().FullName, ex.Message, Environment.NewLine, GetStackTrace(ex));
+			string msg = String.Format("({0}) {1}", ex.GetType().FullName, ex.Message);
+			LogManager.GetLogger(typeof(FrmMainWindow)).Fatal(msg, ex);
 			MessageDialog dialog = new MessageDialog(null, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, false, "An unhandled exception occurred. Please check the log for more details.");
-			dialog.Show();
+			dialog.Run();
 		}
 		
 		private static string GetStackTrace(Exception ex)
@@ -101,7 +102,7 @@
 			
 			if (ex != null)
 			{
-				message  = "Caused by: " + ex.GetType().FullName + Environment.NewLine + ex.StackTrace + Environment.NewLine + GetStackTrace(ex.InnerException);
+				message  = "Caused by: " + ex.GetType().FullName + Environment.NewLine + ex.StackTrace + Environment.NewLine ;
 			}
 			
 			return message;