Esempio n. 1
0
 private static void App_UnhandledException(object sender,
                                            UnhandledExceptionEventArgs
                                            e)
 {
     LogException(e.Exception);
     e.ExitApplication = false;
 }
Esempio n. 2
0
 private void raise_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     if (m_UnhandledExceptionHandlers == null)
     {
         return;
     }
     m_ProcessingUnhandledExceptionEvent = true;
     try
     {
         foreach (UnhandledExceptionEventHandler exceptionEventHandler in m_UnhandledExceptionHandlers)
         {
             if (exceptionEventHandler != null)
             {
                 exceptionEventHandler(sender, e);
             }
         }
     }
     finally
     {
         IEnumerator enumerator = null;
         if (enumerator is IDisposable)
         {
             (enumerator as IDisposable).Dispose();
         }
     }
     m_ProcessingUnhandledExceptionEvent = false;
 }
Esempio n. 3
0
        protected override bool OnUnhandledException(Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs e)
        {
            //var win = new ExceptionWindow(e.Exception) { Topmost = true };
            //win.ShowDialog();

            return(base.OnUnhandledException(e));
        }
        private void UnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs e)
        {
            var form = new ErrorForm(e.Exception.Message);

            form.ShowDialog();
            Environment.Exit(1);
        }
Esempio n. 5
0
        private void SpectrumApplication_UnhandledException(object sender, Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs e)
        {
            MessageBox.Show("SpectrumApplication_UnhandledException");

            //Trace.WriteLine("Unhandled Exception" + e.Exception.ToString());
            //Interaction.MsgBox("Unhandled exception: " + e.Exception.Message, MsgBoxStyle.OkOnly, "Blogger Backup - Unhandled Exception");
            e.ExitApplication = false;
        }
Esempio n. 6
0
 /// <summary>
 ///     重写产生异常的方法
 /// </summary>
 /// <param name="e"></param>
 /// <returns></returns>
 protected override bool OnUnhandledException(UnhandledExceptionEventArgs e)
 {
     e.ExitApplication = false;
     //  LogWriter.CriticalLogInfo("Application Start failed, Exception->{0}", e.Exception);
     //方法会终止进程
     // Environment.FailFast("Application Start faild", e.Exception);
     // Environment.Exit(-1);
     // 返回值 不起作用
     return(e.ExitApplication);
 }
Esempio n. 7
0
            protected override bool OnUnhandledException(Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs e)
            {
                var ex = e.Exception;

                while (ex.InnerException != null)
                {
                    ex = ex.InnerException;
                }
                MessageBox.Show(Application.Current.MainWindow, ex.Message + Environment.NewLine + ex.StackTrace, "Serious problem occured - App may crash!", MessageBoxButton.OK, MessageBoxImage.Error);
                e.ExitApplication = false;
                return(base.OnUnhandledException(e));
            }
Esempio n. 8
0
 protected override bool OnUnhandledException(Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs e)
 {
     if (e.ExitApplication)
     {
         LogManager.GeneralLog.Print(e.Exception, LogLevel.Critical);
     }
     else
     {
         LogManager.GeneralLog.Print(e.Exception, LogLevel.Error);
     }
     return(base.OnUnhandledException(e));
 }
Esempio n. 9
0
            private void MyApplication_UnhandledException(object sender, Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs e)
            {
                string myFilePath = "\\ErrorLog.log";

                using (StreamWriter sw = new StreamWriter(File.Open(myFilePath, FileMode.Append)))
                {
                    sw.WriteLine(DateTime.Now);
                    sw.WriteLine(e.Exception.Message);
                }


                MessageBox.Show("An unexcpected error occured. Application will be terminated.");
                ProjectData.EndApp();
            }
            private void MyApplication_UnhandledException(object sender, Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs e)
            {
                string myFilePath = System.Windows.Forms.Application.StartupPath + "\\ErrorLog.log";

                using (StreamWriter sw = new StreamWriter(File.Open(myFilePath, FileMode.Append)))
                {
                    sw.WriteLine(DateTime.Now);
                    sw.WriteLine(C_General.GetExceptionInfo(e.Exception));
                }


                MessageBox.Show("An unexpected error occured. Check the error log for details.");
                ProjectData.EndApp();
            }
Esempio n. 11
0
        protected virtual bool OnUnhandledException(UnhandledExceptionEventArgs e)
        {
            bool flag;

            if (m_UnhandledExceptionHandlers != null && m_UnhandledExceptionHandlers.Count > 0)
            {
                raise_UnhandledException(this, e);
                if (e.ExitApplication)
                {
                    Application.Exit();
                }
                flag = true;
            }
            else
            {
                flag = false;
            }
            return(flag);
        }
Esempio n. 12
0
        protected override bool OnUnhandledException(Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs e)
        {
            MessageBox.Show("Ha ocurrido un error. Por favor repita la acción.");

            return(true);
        }
Esempio n. 13
0
 protected override bool OnUnhandledException(Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs e)
 {
     return(base.OnUnhandledException(e));
 }
 protected override bool OnUnhandledException(Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs e)
 {
     HideSplashScreen();
     ExceptionHandler.Default.Process(e.Exception, ApplicationStrings.ErrorUnhandledException, ErrorWindow.EMailReport);
     return(true);
 }
Esempio n. 15
0
 private static void OnUnhandledException(object sender, Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs e)
 {
     e.ExitApplication = false;
     Debug.WriteLine(e.Exception);
     ExceptionDialog.ShowDialog(e.Exception);
 }
Esempio n. 16
0
 private void App_UnhandledException(object sender, Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs e)
 {
     ReportException(e.Exception);
 }
Esempio n. 17
0
 private void SingleInstance_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     e.ExitApplication = false;
 }