private void CurrentDomainOnUnhandledException(object sender, UnhandledExceptionEventArgs unhandledExceptionEventArgs)
        {
            // Exception on background thread
            var ex = unhandledExceptionEventArgs.ExceptionObject as Exception;

            if (ex != null)
            {
                ErrorForm.ShowErrorForm(ex);
            }
        }
 private void ApplicationOnThreadException(object sender, ThreadExceptionEventArgs threadExceptionEventArgs)
 {
     ErrorForm.ShowErrorForm(threadExceptionEventArgs.Exception);
 }