{\r
Application.Current.Dispatcher.UnhandledException += this.Dispatcher_UnhandledException;\r
AppDomain.CurrentDomain.UnhandledException +=\r
- new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);\r
+ this.CurrentDomain_UnhandledException;\r
}\r
\r
/// <summary>\r
/// </param>\r
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)\r
{\r
- this.ShowError(e.ExceptionObject);\r
+ if (e.ExceptionObject.GetType() == typeof(FileNotFoundException))\r
+ {\r
+ GeneralApplicationException exception = new GeneralApplicationException("A file appears to be missing.", "Try re-installing Microsoft .NET Framework 4.0", (Exception)e.ExceptionObject);\r
+ this.ShowError(exception);\r
+ }\r
+ else\r
+ {\r
+ this.ShowError(e.ExceptionObject);\r
+ }\r
}\r
\r
/// <summary>\r
private void Dispatcher_UnhandledException(\r
object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)\r
{\r
- if (e.Exception.GetType() == typeof(GeneralApplicationException))\r
+ if (e.Exception.GetType() == typeof(FileNotFoundException))\r
+ {\r
+ GeneralApplicationException exception = new GeneralApplicationException("A file appears to be missing.", "Try re-installing Microsoft .NET Framework 4.0", e.Exception);\r
+ this.ShowError(exception);\r
+ }\r
+ else if (e.Exception.GetType() == typeof(GeneralApplicationException))\r
{\r
this.ShowError(e.Exception);\r
}\r