static private void StartWindow() { SplashScreenManager.ShowForm(typeof(frmSplash)); SplashScreenManager.Default.SetWaitFormDescription("开始加载程序集文件..."); LoadAssembaly(); //SplashScreenManager.Default.SetWaitFormDescription("加载登录模块..."); //SplashScreenManager.ShowForm(typeof(frmSplash)); SplashScreenManager.Default.SetWaitFormDescription("创建主窗口程序..."); BizMainLayout AppMain = new BizMainLayout(false); AppMain.OnStateSync += StateSync; AppMain.OnReadWindowLayout += ReadLayout; SplashScreenManager.Default.SetWaitFormDescription("初始化主窗口程序..."); AppMain.Init(_dbHelper, _loginUser, _stationInfo, null); SplashScreenManager.Default.SetWaitFormDescription("预加载主窗口程序..."); AppMain.BeforeLoadAssembly(); Application.Run(AppMain); }
private void timerDesign_Tick(object sender, EventArgs e) { timerDesign.Enabled = false; _bml.BeforeLoadAssembly(); StateSync(""); _bml.MdiParent = this; _bml.StartPosition = FormStartPosition.CenterScreen; _bml.Show(); }
private void OpenWindowDesign(string designKey, bool isMdiStyle) { ListViewItem[] lvis = listView1.Items.Find(designKey, false); if (lvis.Length <= 0) { MessageBox.Show("未选择需要进行设计的窗体,不能读取布局配置。", "提示"); return; } WindowInfoData wid = (lvis[0].Tag as WindowInfoData); if (wid == null) { MessageBox.Show("窗体信息无效,不能读取布局配置。", "提示"); return; } StationInfo stationInfo = new StationInfo(); stationInfo.DBServerName = (this.Parent.TopLevelControl as frmMainConfig).ServerName; stationInfo.DepartmentId = cbxDepartment.SelectedValue.ToString(); stationInfo.DepartmentName = cbxDepartment.Text; if (isMdiStyle) { frmDesignParent bmlMdi = new frmDesignParent(); bmlMdi.SetDesignText(wid.窗体ID, wid.窗体名称); //配置事件 bmlMdi.OnSaveWindowLayout += SaveLayout; bmlMdi.OnReadWindowLayout += ReadLayout; bmlMdi.OnQueryParentWindowName += QueryLinkWindow; bmlMdi.OnMdiWindowChange += MdiWindowChange; bmlMdi.Init(_dbHelper, _loginUser, stationInfo, null); bmlMdi.Show(this); } else { BizMainLayout bmlPopup = new BizMainLayout(true); bmlPopup.SetDesignText(wid.窗体ID, wid.窗体名称, null, null); //配置事件 bmlPopup.OnStateSync += StateSync; bmlPopup.OnSaveWindowLayout += SaveLayout; bmlPopup.OnReadWindowLayout += ReadLayout; bmlPopup.OnQueryParentWindowName += QueryLinkWindow; bmlPopup.OnMdiWindowChange += MdiWindowChange; bmlPopup.Init(_dbHelper, _loginUser, stationInfo, null); bmlPopup.BeforeLoadAssembly(); bmlPopup.Show(this); } }