コード例 #1
0
        /// 创建启动屏幕对象,显示系统初始化信息,最后显示主窗体
        static void ShowSplashScreen()
        {
            try
            {
                g_StartUpWindow = new StartUpWindow();
                g_StartUpWindow.ShowDialog();

                //显示主窗体
                if (ParSetDisplay.P_I.TypeScreen_e != TypeScreen_enum.S800)
                {
                    if (!ParSetDisplay.P_I.BlSlideWin)//不是边栏窗体
                    {
                        Application application = new Application();
                        application.Run(new WinMain1());
                    }
                    else
                    {
                        Application application = new Application();
                        application.Run(new WinMain2());
                    }
                }
                else
                {
                    Application application = new Application();
                    application.Run(new WinMainSmall2());
                }
            }
            catch (Exception ex)
            {
                Log.L_I.WriteError("Program", ex);
            }
        }
コード例 #2
0
        /// 创建启动屏幕对象,显示系统初始化信息,最后显示主窗体
        static void ShowSplashScreen()
        {
            try
            {
                g_StartUpWindow = new StartUpWindow();
                g_StartUpWindow.ShowDialog();
                //显示主窗体
                Application application = new Application();
                application.Run(new MainWindow());
            }
            catch (Exception ex)
            {
                WinMsgBox.ShowMsgBox("软件发生异常\r①点击确定或取消后软件将关闭 \r②移开此窗口并手动对主界面截屏\r③观察机台内当前巡边玻璃是否已往后流\r④记录时间,发送异常信息日志和运行报警日志到开发人员邮箱");

                BinaryFormatter formatter = null;
                string          path      = Log.CreateAllTimeFile(Log.L_I.PathErrorLog) + "Exception" + DateTime.Now.ToString(" HH-mm-ss") + ".dat";
                using (FileStream ms = new FileStream(path, FileMode.Create))
                {
                    formatter = new BinaryFormatter();
                    formatter.Serialize(ms, ex);
                }
                Log.L_I.WriteError("Program", ex);
            }
        }