示例#1
0
 // Global exception handling
 // (event handler registered in App.xaml)
 void Application_DispatcherUnhandledException( object sender, DispatcherUnhandledExceptionEventArgs e )
 {
     if ( e.Exception is DistributorIntegrityNotLicensedException )
     {
         ShowErrorMessageBox( "There's an integrity issue with your distributor. Please contact your Distributor Administrator." );
         e.Handled = true;
     }
     else if ( e.Exception is DistributorNotLicensedException )
     {
         ShowErrorMessageBox( "There's a problem with your distributor. Please check your Licensing Configuration." );
         e.Handled = true;
     }
     else if ( e.Exception is NotLicensedException )
     {
         ShowErrorMessageBox( "You don't have a license for this feature. Please check your Licensing Status." );
         e.Handled = true;
     }
     else
     {
         //All other exceptions
         string exceptionMessage = e.Exception != null ? e.Exception.ToString() : e.ToString();
         ShowErrorMessageBox( "An error occurred: " + exceptionMessage );
         e.Handled = false;
     }
 }
示例#2
0
 // Global exception handling
 // (event handler registered in App.xaml)
 void Application_DispatcherUnhandledException( object sender, DispatcherUnhandledExceptionEventArgs e )
 {
     if ( e.Exception is NotLicensedException )
     {
         ShowErrorMessageBox( "You don't have a license for this feature" );
         e.Handled = true;
     }
     else
     {
         //All other exceptions
         string exceptionMessage = e.Exception != null ? e.Exception.Message : e.ToString();
         ShowErrorMessageBox( "An error occurred: " + exceptionMessage );
         e.Handled = false;
     }
 }
示例#3
0
        // Global exception handling
        // (event handler registered in App.xaml)
        void Application_DispatcherUnhandledException( object sender, DispatcherUnhandledExceptionEventArgs e )
        {
            if ( e.Exception is NotLicensedException )
            {
                ShowErrorMessageBox( "You don't have a license for this feature" );
                e.Handled = true;

                // Redirect them to the activation dialog so they can install a valid license
                var activationDialog = new ActivationDialog { Owner = MainWindow };
                activationDialog.ShowDialog();
            }
            else
            {
                //All other exceptions
                string exceptionMessage = e.Exception != null ? e.Exception.Message : e.ToString();
                ShowErrorMessageBox( "An error occurred: " + exceptionMessage );
                e.Handled = false;
            }
        }
示例#4
0
 private void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
 {
     Log.e("Unhandled Applicaton Exception: " + e.ToString());
 }
        private void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
        {
            bool logged = false;
            e.Handled = true;

            try
            {
                ILoggingService loggingService = ToolsUIApplication.Instance.RootServiceProvider.GetService(typeof(ILoggingService)) as ILoggingService;
                if (loggingService != null)
                {
                    loggingService.LogException(e.Exception);
                    logged = true;
                }
            }
            finally
            {
                if (!logged)
                {
                    Debug.WriteLine("Exception: " + e.ToString());
                }
            }

            if (Debugger.IsAttached)
            {
                Debugger.Break();
            }
        }
示例#6
0
        private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
        {
#if DEBUG
            MessageBox.Show(Utilities.TextTidy(e.ToString()), "Unhandled Anomaly!", MessageBoxButton.OK, MessageBoxImage.Error);
#endif
        }
示例#7
0
 void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
 {
     AsyncLogger.LogException(Tag, e.ToString());
     // Prevent default unhandled exception processing
     e.Handled = false;
 }
示例#8
0
 private void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
 {
     AdonisUI.Controls.MessageBox.Show(e.ToString() !, "Error", AdonisUI.Controls.MessageBoxButton.OK, AdonisUI.Controls.MessageBoxImage.Error);
     e.Handled = true;
 }