Example #1
0
 private void App_DispatcherUnhandledException(
     object sender,
     DispatcherUnhandledExceptionEventArgs e)
 {
     App.logger.Fatal("UNEXPECTED EXCEPTION:" + e.Exception.Message + (object)e.Exception.InnerException);
     CashDrawerService.Disconnect();
     if (WPFMessageBox.Show(Resources.ExceptionGeneral + e.Exception.Message, Resources.ExceptionGeneralTitle, MessageBoxButton.OK, MessageBoxImage.Hand) == MessageBoxResult.OK)
     {
         e.Handled = true;
         MediaTypeNames.Application.Current.Shutdown();
     }
     e.Handled = true;
 }
Example #2
0
 protected override void OnExit(ExitEventArgs e)
 {
     base.OnExit(e);
     CashDrawerService.Disconnect();
 }