public static void TestAll() { SystemConfiguration.UseMultiThread = false; //if (MessageForm.ShowYesNo("Operate Data?")) { operateData = true; } m_stringExceptionProcess.Clear(); var instance = DefaultServiceProvider.Instance; IExceptionProcess defaultEp = null; IMessageBox defaultMb = null; if (instance != null) { defaultEp = ServiceProvider.GetService <IExceptionProcess>(); instance.SetDefaultService <IExceptionProcess>(m_stringExceptionProcess); defaultMb = ServiceProvider.GetService <IMessageBox>(); instance.SetDefaultService <IMessageBox>(m_emptyMessageBox); ServiceProvider.Clear(); } IList <MenuInfo> menuInfos = ADInfoBll.Instance.GetTopMenuInfos(); foreach (MenuInfo info in menuInfos) { TestMenu(info); } if (instance != null) { instance.SetDefaultService <IExceptionProcess>(defaultEp); instance.SetDefaultService <IMessageBox>(defaultMb); ServiceProvider.Clear(); } SystemConfiguration.UseMultiThread = true; ErrorReport errorReport = new ErrorReport("测试中的异常,请见详细内容。", "测试信息", MessageImage.Information, m_stringExceptionProcess.Exceptions); errorReport.ShowDialog(); }
// Creates the error message and displays it. private void ShowThreadExceptionDialog(Exception ex) { if (SystemConfiguration.IsInDebug) { string errorMsg = ExceptionHelper.GetExceptionDetail(ex); string caption = ExceptionHelper.GetExceptionMessage(ex); //return MessageForm.ShowError(errorMsg); using (ErrorReport form = new ErrorReport(caption, "´íÎó", MessageImage.Error, errorMsg)) { form.ShowDialog(); } } else { //return DialogResult.OK; string caption = ExceptionHelper.GetExceptionMessage(ex); MessageForm.ShowError(caption); } }
public static void TestAll() { SystemConfiguration.UseMultiThread = false; //if (MessageForm.ShowYesNo("Operate Data?")) { operateData = true; } m_stringExceptionProcess.Clear(); var instance = DefaultServiceProvider.Instance; IExceptionProcess defaultEp = null; IMessageBox defaultMb = null; if (instance != null) { defaultEp = ServiceProvider.GetService<IExceptionProcess>(); instance.SetDefaultService<IExceptionProcess>(m_stringExceptionProcess); defaultMb = ServiceProvider.GetService<IMessageBox>(); instance.SetDefaultService<IMessageBox>(m_emptyMessageBox); ServiceProvider.Clear(); } IList<MenuInfo> menuInfos = ADInfoBll.Instance.GetTopMenuInfos(); foreach (MenuInfo info in menuInfos) { TestMenu(info); } if (instance != null) { instance.SetDefaultService<IExceptionProcess>(defaultEp); instance.SetDefaultService<IMessageBox>(defaultMb); ServiceProvider.Clear(); } SystemConfiguration.UseMultiThread = true; ErrorReport errorReport = new ErrorReport("测试中的异常,请见详细内容。", "测试信息", MessageImage.Information, m_stringExceptionProcess.Exceptions); errorReport.ShowDialog(); }