示例#1
0
 private void Form1_Load(object sender, EventArgs e)
 {
     base.TopMost = true;
     SplashForm.CloseSplash();
     base.TopMost = true;
     base.TopMost = false;
 }
示例#2
0
        private void FrmMain_Shown(object sender, EventArgs e)
        {
            this.Activate();
            //close the splash screen
            SplashForm.CloseSplash();

            Application.UseWaitCursor = false;
        }
示例#3
0
        private void QueryLog()
        {
            if (txtStartDate.Value > txtEndDate.Value)
            {
                MessageBoxHelper.ShowWarningMsg(RDIFrameworkMessage.MSG0208);
                txtStartDate.Focus();
                return;
            }

            try
            {
                this.Cursor = Cursors.WaitCursor;
                SplashForm.StartSplash();
                var whereStatement = " 1 = 1";
                if (!string.IsNullOrEmpty(this.txtUserName.Text.Trim()))
                {
                    whereStatement += "  and " + CiLogTable.FieldUserRealName + " like '%" + txtUserName.Text.Trim() + "%'";
                }

                if (!string.IsNullOrEmpty(this.txtIPAddress.Text.Trim()))
                {
                    whereStatement += " and " + CiLogTable.FieldIPAddress + "like '%" + txtIPAddress.Text.Trim() + "%'";
                }

                if (SystemInfo.RDIFrameworkDbType == CurrentDbType.Oracle)
                {
                    whereStatement += " and " + CiLogTable.FieldCreateOn + ">=" + BusinessLogic.GetOracleDateFormat(txtStartDate.Value);
                    whereStatement += " and " + CiLogTable.FieldCreateOn + "<" + BusinessLogic.GetOracleDateFormat(txtEndDate.Value.AddDays(1));
                }
                else
                {
                    whereStatement += " and " + CiLogTable.FieldCreateOn + ">='" + txtStartDate.Value.ToString("yyyy-MM-dd") + "'";
                    whereStatement += " and " + CiLogTable.FieldCreateOn + "<'" + txtEndDate.Value.AddDays(1).ToString("yyyy-MM-dd") + "'";
                }

                var recordCount = 0;
                this.dtLog            = RDIFrameworkService.Instance.LogService.GetDTByPage(this.UserInfo, out recordCount, ucPagerEx.PageIndex, ucPagerEx.PageSize, whereStatement, CiLogTable.FieldCreateOn + " DESC");
                ucPagerEx.RecordCount = recordCount;
                ucPagerEx.InitPageInfo();

                this.dgvInfo.AutoGenerateColumns = false;
                this.dgvInfo.DataSource          = this.dtLog.DefaultView;
            }
            catch (Exception ex)
            {
                base.ProcessException(ex);
            }
            finally
            {
                SplashForm.CloseSplash();
                this.Cursor = Cursors.Default;
            }
        }
        private void cboCurrentSystem_SelectedIndexChanged(object sender, EventArgs e)
        {
            SplashForm.StartSplash();
            //清空功能按钮
            if (this.ribbonControlMain.Items != null && this.ribbonControlMain.Items.Count > 0)
            {
                this.ribbonControlMain.Items.Clear();
            }

            if (this.ribbonControlMain.Items != null && this.ribbonControlMain.Items.Count > 0)
            {
                this.ribbonControlMain.Items.Clear();
            }

            LoadSildeBar(dicSubSystem[cboCurrentSystem.Text.Trim()]);
            SplashForm.CloseSplash();
        }
示例#5
0
        /// <summary>
        /// Runs the game.
        /// </summary>
        public void Run()
        {
            IsRunning = true;

            try
            {
                // 创建log
                NLogger.Instance.AddLogOutput(new NFileLogOutput("NexusGameClient.log"));

                SplashForm.StartSplash(Resources.EditorSplash);

                // 初始化本地化信息
                InitCultureInfo();

                // 初始化Nexus Engine
                InitGameEngine();

                // 引擎初始化完成
                PostInitGameEngine();

                SplashForm.CloseSplash();

                gameTime.ElapsedGameTime = 0;
                gameTime.ElapsedRealTime = 0;
                gameTime.TotalGameTime   = (float)totalGameTime.TotalSeconds;
                gameTime.TotalRealTime   = (float)clock.CurrentTime.TotalSeconds;

                Update(gameTime);

                Application.Idle += Application_Idle;
                Application.Run(GameWindow);
            }
            catch (System.Exception e)
            {
                Program.ShowException(e, "Create Default Level Exception!");
            }
            finally
            {
                Application.Idle -= Application_Idle;
                gameEngine.Close();
                gameEngine.Dispose();
                NLogger.Instance.Clear();
                IsRunning = false;
                OnExiting(EventArgs.Empty);
            }
        }
示例#6
0
        static void Main()
        {
            System.Environment.CurrentDirectory = Path.GetDirectoryName(Application.ExecutablePath);
            var errorHandler = new ErrorHandlerPPD();

            errorHandler.Initialize();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Game game = null;

            try
            {
                PPDSetting.Initialize();
                game = new MyGame(new PPDExecuteArg(new string[] { }));
                game.Run();
            }
            catch (Exception e)
            {
                SplashForm.CloseSplash();
                errorHandler.ProcessError(e);
                if (game != null)
                {
                    try
                    {
                        game.Window.RescueData();
                    }
                    catch
                    {
                    }
                    game.Window.Close();
                }
            }
            finally
            {
                if (game != null)
                {
                    game.Dispose();
                    game = null;
                }
            }
        }
 private void cboCurrentSystem_SelectedIndexChanged(object sender, EventArgs e)
 {
     SplashForm.StartSplash();
     LoadSildeBar();
     SplashForm.CloseSplash();
 }
示例#8
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            if (!File.Exists(@".\splash.png"))
            {
                //Assembly assem = this.GetType().Assembly;
                Assembly assem  = System.Reflection.Assembly.GetEntryAssembly();
                Stream   stream = assem.GetManifestResourceStream("ATEYieldRateStatisticSystem.Resources.Splash.png");
                System.Drawing.Image.FromStream(stream).Save("splash.png");
            }

            SplashForm.StartSplash(@".\splash.png", Color.FromArgb(128, 128, 128));
            //Application.Run (new SplashForm());
            // simulating operations at startup '
            if (!p.checkFolder())
            {
                MessageBox.Show("Create app folder fail,program will exit.", "Create Folder Fail", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                System.Threading.Thread.Sleep(1000);
                SplashForm.CloseSplash();
                Environment.Exit(0);
            }

            if (!File.Exists(@".\IrisSkin4.dll"))
            {
                if (!downloadIrisSkin4())
                {
                    System.Threading.Thread.Sleep(1000);
                    SplashForm.CloseSplash();
                    Environment.Exit(0);
                }
            }


            if (!File.Exists(@".\System.Data.SQLite.dll"))
            {
                if (!downloadSqliteDll())
                {
                    System.Threading.Thread.Sleep(1000);
                    SplashForm.CloseSplash();
                    Environment.Exit(0);
                }
            }

            if (!File.Exists(@".\SQLite.Interop.dll"))
            {
                if (!downloadSqliteInterop())
                {
                    System.Threading.Thread.Sleep(1000);
                    SplashForm.CloseSplash();
                    Environment.Exit(0);
                }
            }

            if (!File.Exists(@".\MySql.Data.dll"))
            {
                if (!downloadMySqlData())
                {
                    System.Threading.Thread.Sleep(1000);
                    SplashForm.CloseSplash();
                    Environment.Exit(0);
                }
            }


            if (!p.checkDB(p.LocalDB))
            {
                System.Threading.Thread.Sleep(1000);
                SplashForm.CloseSplash();
                Environment.Exit(0);
            }



            if (!File.Exists(p.AppFolder + @"\MacOS.ssk"))
            {
                if (!downloadSkin())
                {
                    System.Threading.Thread.Sleep(1000);
                    SplashForm.CloseSplash();
                    Environment.Exit(0);
                }
            }
            //MessageBox.Show(p.AppStart.ToString());

            //check ini file
            if (!File.Exists(p.iniFilePath))
            {
                p.createIniFile(p.iniFilePath);
            }
            p.readIniValue(p.iniFilePath);//exits,read ini file

            p.autoSelectConnstring();



            //create mysql db
            string result = "";

            if (!p.createDB(p.connstringNoDB, out result))
            {
                if (p.AppStart == p.AppStartModel.ATEClient)
                {
                    MessageBox.Show(result + ",the data will record in the local db.");
                }
                if (p.AppStart == p.AppStartModel.YRServer)
                {
                    MessageBox.Show(result + "the program will exit...");
                    System.Threading.Thread.Sleep(1000);
                    SplashForm.CloseSplash();
                    Environment.Exit(0);
                }
            }
            else
            {
                if (!p.createMysqlTable(p.connString, out result))
                {
                    MessageBox.Show(result);
                }
            }

            System.Threading.Thread.Sleep(1000);
            // close the splash screen'
            SplashForm.CloseSplash();

            //創建桌面快捷方式
            //Shortcut.Shortcut.CreateShortcut(Shortcut.Shortcut.GetDeskDir() + "\\ATEYieldRateStatisticSystem.lnk",Application.StartupPath + @"\\ATEYieldRateStatisticSystem", Shortcut.Shortcut.GetDeskDir(), "ATEYieldRateStatisticSystem", AppDomain.CurrentDomain.BaseDirectory + "favicon.ico");
            Shortcut.Shortcut.CreateDesktopShortcut(Application.StartupPath + "\\ATEYieldRateStatisticSystem.lnk", "ATEYieldRateStatisticSystem");

            //創建開機啟動
            //UICmd("正在读取 全局用户开始菜单启动文件夹");
            p.saveLog(DateTime.Now.ToString("HH:mm:ss") + "->" + "正在读取 全局用户开始菜单启动文件夹");
            string commonStartup = Environment.GetFolderPath(Environment.SpecialFolder.CommonStartup);

            // UICmd("CommonStartup:" + commonStartup);
            if (ShortcutTool.Create(commonStartup, AppName, AppFile))
            {
                p.saveLog(DateTime.Now.ToString("HH:mm:ss") + "->" + "添加 全局用户开始菜单启动 成功");
            }
            else
            {
                p.saveLog(DateTime.Now.ToString("HH:mm:ss") + "->" + "添加 全局用户开始菜单启动 失败");
            }
            p.saveLog(DateTime.Now.ToString("HH:mm:ss") + "->" + "正在读取 当前用户开始菜单启动文件夹");
            string startup = Environment.GetFolderPath(Environment.SpecialFolder.Startup);

            //UICmd("Startup:" + startup);
            p.saveLog(DateTime.Now.ToString("HH:mm:ss") + "->" + "Startup:" + startup);
            if (ShortcutTool.Create(startup, AppName, AppFile))
            {
                //UICmd("添加 当前用户开始菜单启动 成功");
                p.saveLog(DateTime.Now.ToString("HH:mm:ss") + "->" + "添加 当前用户开始菜单启动 成功");
            }
            else
            {
                //UICmd("添加 当前用户开始菜单启动 失败");
                p.saveLog(DateTime.Now.ToString("HH:mm:ss") + "->" + "添加 当前用户开始菜单启动 失败");
            }



            if (p.AppStart == p.AppStartModel.ATEClient)
            {
                Application.Run(new frmATEClient());
            }
            else if (p.AppStart == p.AppStartModel.YRServer)
            {
                //Application.Run(new frmYRMonitor());
                Application.Run(new frmYROverAll());
            }
            //Application.Run(new frmQueryFR());
            //Application.Run(new frmFTYR());
            //Application.Run(new frmYRbyLine());
            else
            {
                Application.Run(new frmMain());
            }
        }
示例#9
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // 创建log
            NLogger.Instance.AddLogOutput(new NFileLogOutput("NexusEditor.log"));

            // 读取本地化配置
            NexusEditor.Properties.Resources.Culture = new CultureInfo(ConfigurationManager.AppSettings["Localization"]);

            SplashForm.StartSplash(NexusEditor.Properties.Resources.EditorSplash);

            try
            {
                engine = new NLevelEditorEngine();
                engine.InitCore();

                mainForm = new EditorMainForm();
                mainForm.CreateLogForm();

                //-- create engine config
                CustomConfigurationSection configuration = CustomConfigurationSection.Open();
                mainForm.ClientSize = new Size(configuration.EngineSetting.ClientWidth, configuration.EngineSetting.ClientHeight);
                NEngineConfig engineCfg = new NEngineConfig();
                engineCfg.RenderWndHandle    = mainForm.RenderPanelHandle;
                engineCfg.ClientWidth        = Screen.PrimaryScreen.Bounds.Width;
                engineCfg.ClientHeight       = Screen.PrimaryScreen.Bounds.Height;
                engineCfg.ColorBits          = configuration.EngineSetting.ColorBits;
                engineCfg.FullScreen         = configuration.EngineSetting.FullScreen;
                engineCfg.EnableHDR          = configuration.EngineSetting.EnableHDR;
                engineCfg.EnableSSAO         = configuration.EngineSetting.EnableSSAO;
                engineCfg.RenderClass        = configuration.EngineSetting.RenderClass;
                engineCfg.FileSystemClass    = configuration.EngineSetting.FileSystemClass;
                engineCfg.EngineDataPkg      = configuration.EngineSetting.EngineDataPkg;
                engineCfg.ResourceCacheClass = configuration.EngineSetting.ResourceCacheClass;
                engineCfg.ResourceIOClass    = configuration.EngineSetting.ResourceIOClass;
                engineCfg.FileSystemRoot     = configuration.EngineSetting.FileSystemRoot;
                if (string.IsNullOrEmpty(engineCfg.FileSystemRoot))
                {
                    engineCfg.FileSystemRoot = NFileSystem.DefaultFileSystemRoot;
                }

                //--
                NEditorConfig editorCfg = new NEditorConfig();
                editorCfg.actorEdClassAssembly = configuration.EditorEngineSetting.ActorEdClassAssembly;
                editorCfg.actorEditorClass     = configuration.EditorEngineSetting.ActorEditorClass;

                configuration.Save();

                engine.InitModules(engineCfg, editorCfg);
            }
            catch (System.Exception e)
            {
                ShowException(e, "Nexus Engine Init FAILED!");
                engine.Dispose();
                mainForm.Dispose();
                return;
            }

            try
            {
                //-- create default level
                engine.CreateMainLevel("defaultLevel");

                //-- create editor windows
                mainForm.CreateEditorForms();
                mainForm.CreateViewport();

                //-- open resrouce
                resourceForm = new ResourceEditorForm();

                SplashForm.CloseSplash();

                //-- run
                resourceForm.Show();
                mainForm.Show();
                mainForm.BringToFront();
                Application.Run(mainForm);
            }
            catch (System.Exception e)
            {
                ShowException(e, "Nexus Engine Exception!");
            }
            //-- close
            resourceForm.Close();
            engine.Close();
            engine.Dispose();

            NLogger.Instance.Clear();

            mainForm.Dispose();
        }