Exemple #1
0
        void Current_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
        {
            var a = e.Exception is ApplicationException;

            e.Handled = true;
            LoggerManagerSingle.Instance.Error(e.Exception);
            _msgBox.ShowDialogErrorMsg("程序出现严重错误,即将关闭");
            Application.Current.Shutdown();
        }
Exemple #2
0
 public bool ShowDialogErrorMsg(string errorText)
 {
     if (_msgBox != null)
     {
         bool ret = false;
         SystemContext.Instance.AsyncOperation.SynchronizationContext.Post(
             state => { ret = _msgBox.ShowDialogErrorMsg(errorText); }, null);
         return(ret);
     }
     else
     {
         MessageBoxResult result = MessageBox.Show(errorText, "提示");
         return(result == MessageBoxResult.OK);
     }
 }