Exemplo n.º 1
0
        static void currentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            formErrorMessage dialog = new formErrorMessage(e);
             dialog.ShowDialog();

             Instances.MainForm.Repaint();
        }
Exemplo n.º 2
0
        private static void currentDomain_ThreadException(object sender, ThreadExceptionEventArgs t)
        {
            System.Runtime.InteropServices.COMException comEx = t.Exception as System.Runtime.InteropServices.COMException;

             if (comEx != null)
             {
            // RPC server fault.
            if (comEx.ErrorCode == -2147417851 || comEx.ErrorCode == -2147023174)
            {
               // Connection
               HandleConnectionLost();
               return;
            }
             }

             formErrorMessage dialog = new formErrorMessage(t);
             dialog.ShowDialog();

             Instances.MainForm.Repaint();
        }