Dispatcher.UnhandledExceptionFilter 活動
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
當執行代理時拋出一個執行緒例外,且未被捕捉到,無論是在 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則事件不會被提出。