Exemplo n.º 1
0
        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();
        }