// Very crude way to wrap the unhandled exception so it LOOKS like .NET event args private void ExceptionHandler(object sender, Exception e) { ExceptonHandler eh = UnHandledException; if (eh != null) { eh(this, e); } }
/// <summary> /// Raises unhandled exception event on the subscriber's thread. /// If there is no subscriber, display message box.</summary> /// <param name="ex">Exception</param> private void OnUnHandledException(Exception ex) { ExceptonHandler handler = UnHandledException; if (handler == null) { return; } m_cctx.Send(delegate { handler(this, ex); }, null); }