Dispatcher.UnhandledException 活動
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
當執行代理時拋出一個執行緒例外並未被捕捉,當執行代理由 或 InvokeBeginInvoke執行時發生。
public:
event System::Windows::Threading::DispatcherUnhandledExceptionEventHandler ^ UnhandledException;
public event System.Windows.Threading.DispatcherUnhandledExceptionEventHandler UnhandledException;
member this.UnhandledException : System.Windows.Threading.DispatcherUnhandledExceptionEventHandler
Public Custom Event UnhandledException As DispatcherUnhandledExceptionEventHandler
Public Event UnhandledException As DispatcherUnhandledExceptionEventHandler
事件類型
備註
當執行代表InvokeBeginInvoke時被拋棄的例外未被接住,該事件即被提出。
處理器可以將異常標記為已處理,這會阻止內部異常處理器被呼叫。
此事件的事件處理程序必須謹慎撰寫,以避免產生次級例外並捕捉任何異常。 建議避免在處理器中分配記憶體或執行任何資源密集操作。
這個 UnhandledExceptionFilter 事件提供了一個不讓事件升級 UnhandledException 的手段。
UnhandledExceptionFilter事件先被提出,若 RequestCatch 在 上 DispatcherUnhandledExceptionFilterEventArgs 被設定為 false,UnhandledException則事件不會被提出。