예제 #1
0
        private void MMenuConfigView_Click(object sender, EventArgs e)
        {
            ConfigViewFm Fm = new ConfigViewFm();

            if (Fm.ShowDialog() == DialogResult.OK)
            {
                foreach (Form cfm in this.MdiChildren)
                {
                    if (cfm is IScheduleFm)
                    {
                        (cfm as IScheduleFm).ScheduleUpdate(eScheduleUpdateKind.RefreshRule);

                        //补丁
                        cfm.Width = cfm.Width + 1;
                        cfm.Width = cfm.Width - 1;
                    }
                }
            }
        }
예제 #2
0
        private void MainFm_Load(object sender, EventArgs e)
        {
            this.WindowState = ExDbg.IsAttached ? FormWindowState.Normal : FormWindowState.Maximized;

            VC2WinFmApp.ErrorLog = new SimpleLogImpl_Text(ExApp_WinFm.GetAssistFileName("Log", "_Error.Log"), true, 10 * 1000, LogLevel.All);

            String connStr;
            var    dbFile = Application.StartupPath + "\\VC.mdb";

            if (new FileInfo(dbFile).Exists)
            {
                connStr = String.Format(VC2WinFmApp.cConnStr, dbFile);
            }
            else
            {
                dbFile  = Application.StartupPath + "\\..\\..\\VC.mdb";
                connStr = String.Format(VC2WinFmApp.cConnStr, dbFile);
            }

            var dac = new DataAccessImpl(connStr, VC2WinFmApp.ErrorLog);

            VC2WinFmApp.Cfg = dac.Config;

            VC2WinFmApp.MainFm        = this;
            VC2WinFmApp.DataRule      = new DataRuleImpl(dac);
            VC2WinFmApp.Engine        = new EngineV2(VC2WinFmApp.DataRule);
            VC2WinFmApp.DataFacade    = new DataFacadeImpl(VC2WinFmApp.DataRule);
            VC2WinFmApp.MessageSwitch = new MessageSwitch();

            VC2WinFmApp.Engine.GroupChange    += VC2WinFmApp.MessageSwitch.OnGroupChange;
            VC2WinFmApp.Engine.FailActChange  += VC2WinFmApp.MessageSwitch.OnFailActChange;
            VC2WinFmApp.Engine.ModifiedChange += VC2WinFmApp.MessageSwitch.OnModifiedChange;
            VC2WinFmApp.Engine.ScheduleUpdate += VC2WinFmApp.MessageSwitch.OnScheduleUpdate;

            ConfigViewFm.LoadViewStyle();
            this.Text = VC2WinFmApp.Name;
            AddExportMenu();

            DataGrpBind = new GridViewBind <BaseEntity>(GroupGrid,
                                                        columnMng: new GridBindColumnMngImpl_Appoint(
                                                            new GridBindColumnAndPropertyMap("Name", new GridBindColumnAttribute {
                Title = "名称"
            })));
            DataMbrBind = new GridViewBind <BaseEntity>(MemberGrid,
                                                        columnMng: new GridBindColumnMngImpl_Appoint(
                                                            new GridBindColumnAndPropertyMap("Name", new GridBindColumnAttribute {
                Title = "名称"
            })));
            FailActBind = new GridViewBind <EnFailAct>(FailActGrid,
                                                       columnMng: new GridBindColumnMngImpl_Appoint(
                                                           new GridBindColumnAndPropertyMap("Name", new GridBindColumnAttribute {
                Title = "任务名称"
            })));

            Application.DoEvents();
            VC2WinFmApp.Engine.Init();
            new FormMemoryImpl(this, VC2WinFmApp.Cfg, "FormRem");

            try
            {
                if (!ExDbg.IsAttached)
                {
                    Process.Start(VC2WinFmApp.ProductHomePage);
                }
            }
            catch
            {
            }
        }