语言

Dispatcher.UnhandledExceptionFilter 活动

定义

在通过筛选阶段或Invoke筛选器阶段执行委托BeginInvoke期间引发和未捕获线程异常时发生。

public:
 event System::Windows::Threading::DispatcherUnhandledExceptionFilterEventHandler ^ UnhandledExceptionFilter;
[add: System.Security.SecurityCritical]
[remove: System.Security.SecurityCritical]
public event System.Windows.Threading.DispatcherUnhandledExceptionFilterEventHandler UnhandledExceptionFilter;
public event System.Windows.Threading.DispatcherUnhandledExceptionFilterEventHandler UnhandledExceptionFilter;
[<add: System.Security.SecurityCritical>]
[<remove: System.Security.SecurityCritical>]
member this.UnhandledExceptionFilter : System.Windows.Threading.DispatcherUnhandledExceptionFilterEventHandler 
member this.UnhandledExceptionFilter : System.Windows.Threading.DispatcherUnhandledExceptionFilterEventHandler 
Public Custom Event UnhandledExceptionFilter As DispatcherUnhandledExceptionFilterEventHandler 

事件类型

特性

注解

此事件在筛选阶段引发,该异常是在委托执行期间通过或InvokeBeginInvoke未捕获的异常引发的。

此时不会取消调用堆栈(第一次机会异常)。

必须谨慎编写此事件的事件处理程序,以避免创建辅助异常并捕获发生的任何异常。 建议避免在处理程序中分配内存或执行任何资源密集型操作。

该 UnhandledExceptionFilter 事件提供了一种不引发 UnhandledException 事件的方法。 首先UnhandledExceptionFilter引发该事件,如果RequestCatch设置为DispatcherUnhandledExceptionFilterEventArgs该false事件,UnhandledException则不会引发该事件。

适用于

另请参阅