public override void OnModelChange(object sender, object args) { ApplicationForm AppForm = sender as ApplicationForm; if (AppForm != null) { if (this.GetWorkAreas.LogContent.Count == 0) { //AppForm.Btn_Fun_Rec.Enabled = false; } else { //AppForm.Btn_Fun_Rec.Enabled = true; } } //添加功能区 ABaseForm form = args as ABaseForm; if (form != null) { this.UseFunction(form); //操作日志处理 if (this.ALogForm != null) { this.ALogForm.LogContent = form.LogContent; this.ALogForm.Init(); } form.functionList1.Visible = true; form.functionList1.Dock = DockStyle.Fill; this.dp_Function.ControlContainer.Controls.Clear(); this.dp_Function.ControlContainer.Controls.Add(form.functionList1); } base.OnModelChange(sender, args); }
/// <summary> /// 当工作区域删除窗体的时候调用 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void WorkPanel_ControlRemoved(object sender, ControlEventArgs e) { ABaseForm form = (e.Control as ABaseForm); if (form != null) { form.OnRemoveForm(); } }
public AreaQuantityUnit(_Business p_Business, _UnitProject p_Activitie, ABaseForm p_AParentForm, string p_FormName) { this.CurrentBusiness = p_Business; this.Activitie = p_Activitie; this.AParentForm = p_AParentForm; m_Methods_Subheadings = new _Methods_Subheadings(this.Activitie); this.Text = p_FormName; InitializeComponent(); }
/// <summary> /// 要执行那个窗体 /// </summary> /// <param name="p_key"></param> private void doAction(string p_key) { ABaseForm from = null; this.CurrentBusiness.FastCalculate(); if (FormList.Contains(p_key)) { from = this.FormList[p_key] as ABaseForm; from.MustInit(); //第二次加载的时候每次执行 from.Init(); } else { switch (p_key) { case "分部分项": from = new SubSegmentForm(); SubsegmentForm = from as SubSegmentForm; break; //case "工程信息": // from = new ProInformation(); // break; case "基本信息": from = new CBaseUnitProInfo(); from.CurrentBusiness = this.CurrentBusiness; (from as CBaseUnitProInfo).UnitProject = this.Activitie; break; case "工料机汇总": from = new UnitSummaryForm(this.Activitie, this.CurrentBusiness); break; case "汇总分析": from = new CMetaanalysisForm(); //设置当前的单位工程 this.MetaanalysisForm = from as CMetaanalysisForm; this.MetaanalysisForm.UnitProject = this.Activitie; break; case "其他项目": from = new OtherProjectForm(this.Activitie); break; case "措施项目": from = new MeasuresProjectForm(); break; case "工程历史": from = new CHistoryForm(); break; case "报表": from = new ReportForm(); break; //case "参数设置": // from = new ParameterSettings(); break; case "单位工程自检": from = new ProjectCheck(); break; } if (from == null) { return; } from.CurrentBusiness = this.CurrentBusiness; from.Activitie = this.Activitie; from.BusContainer = this; from.TopLevelForm = this.MainForm; from.FormBorderStyle = FormBorderStyle.None; from.Dock = DockStyle.Fill;//设置样式是否填充整个PANEL //设置为非顶级控件 from.TopLevel = false; //显示窗体 from.Visible = true; this.FormList.Add(p_key, from); } //添加之前保存当时的界面配置 this.WorkPanel.Controls.Clear(); this.WorkPanel.Controls.Add(from); if (Parent_Projects != null) { Parent_Projects.OnModelChange(this, from); } else { this.OnModelChange(this, from); } }