Exemplo n.º 1
0
 private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
 {
     //Handling the exception within the UnhandledExcpeiton handler.
     #if DEBUG
     MessageBoxResult res = MessageBox.Show(e.Exception.Message, "Exception Caught", MessageBoxButton.OKCancel, MessageBoxImage.Error);
     WiteErrorLog(e.Exception.Message);
     e.Handled = true;
     if (res.CompareTo(MessageBoxResult.OK) == 0)
     {
         base.Shutdown();
     }
     #else
     WiteErrorLog(e.Exception.Message);
     e.Handled = true;
     base.Shutdown();
     #endif
 }