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); } }
public void SetDesignText(string designWindowKey, string designName) { _bml.SetDesignText(designWindowKey, designName, panel1, panel2); }