當前位置: 首頁>>代碼示例>>C#>>正文


C# DispatcherUnhandledExceptionEventArgs.ToString方法代碼示例

本文整理匯總了C#中System.Windows.Threading.DispatcherUnhandledExceptionEventArgs.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# DispatcherUnhandledExceptionEventArgs.ToString方法的具體用法?C# DispatcherUnhandledExceptionEventArgs.ToString怎麽用?C# DispatcherUnhandledExceptionEventArgs.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Windows.Threading.DispatcherUnhandledExceptionEventArgs的用法示例。


在下文中一共展示了DispatcherUnhandledExceptionEventArgs.ToString方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Application_DispatcherUnhandledException

 // 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;
     }
 }
開發者ID:ps-PKrueger,項目名稱:samples,代碼行數:27,代碼來源:App.xaml.cs

示例2: Application_DispatcherUnhandledException

 // 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;
     }
 }
開發者ID:paulcoonan,項目名稱:samples,代碼行數:17,代碼來源:App.xaml.cs

示例3: Application_DispatcherUnhandledException

        // 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;
            }
        }
開發者ID:ps-PKrueger,項目名稱:samples,代碼行數:21,代碼來源:App.xaml.cs

示例4: App_DispatcherUnhandledException

        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();
            }
        }
開發者ID:UnaNancyOwen,項目名稱:Kinect-Studio-Sample,代碼行數:27,代碼來源:App.xaml.cs

示例5: Application_DispatcherUnhandledException

        private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
        {
#if DEBUG
            MessageBox.Show(Utilities.TextTidy(e.ToString()), "Unhandled Anomaly!", MessageBoxButton.OK, MessageBoxImage.Error);
#endif
        }
開發者ID:BdGL3,項目名稱:CXPortal,代碼行數:6,代碼來源:App.xaml.cs

示例6: App_DispatcherUnhandledException

 void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
 {
     AsyncLogger.LogException(Tag, e.ToString());
     // Prevent default unhandled exception processing
     e.Handled = false;
 }
開發者ID:Rai4n,項目名稱:TVShowRemember,代碼行數:6,代碼來源:App.xaml.cs


注:本文中的System.Windows.Threading.DispatcherUnhandledExceptionEventArgs.ToString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。