当前位置: 首页>>代码示例>>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;未经允许,请勿转载。