本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
}
示例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();
}
}
示例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
}
示例6: App_DispatcherUnhandledException
void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
AsyncLogger.LogException(Tag, e.ToString());
// Prevent default unhandled exception processing
e.Handled = false;
}