private void btnAdd_Click(object sender, EventArgs e) { this.bListNull = true; this.m_TempCellModule.AddNewSite(null); string strName = this.SetDefaultName(); TemplateCellPropertiesFrm frm = new TemplateCellPropertiesFrm(this.m_model, this.m_TempCellModule.TplCellColl, this.m_TempCellModule.NewTemplate, strName, this.bListNull); frm.TemplateListCancelEvent -= new TemplateCellPropertiesFrm.TemplateListCancelHandle(this.newPropertiesForm_TemplateListCancelEvent); frm.TemplateListCancelEvent += new TemplateCellPropertiesFrm.TemplateListCancelHandle(this.newPropertiesForm_TemplateListCancelEvent); frm.TemplateListEvent -= new TemplateCellPropertiesFrm.TemplateListChangeHandle(this.newPropertiesForm_TemplateListEvent); frm.TemplateListEvent += new TemplateCellPropertiesFrm.TemplateListChangeHandle(this.newPropertiesForm_TemplateListEvent); frm.ShowDialog(); this.bListNull = false; this.SetBtnDeleteEnable(); }
private void btnDuplicate_Click(object sender, EventArgs e) { if (this.ltbTemplate.SelectedItem == null) { MessageBox.Show(NEResource.NE_MES_SELECT_TEMP, NEResource.NE_UNET, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { string name = "Copy of " + this.ltbTemplate.SelectedItem.ToString(); for (int i = 2; this.m_TempCellModule.IsExistTplSite(name); i++) { name = string.Concat(new object[] { "Copy", i, " of ", this.ltbTemplate.SelectedItem.ToString() }); } this.m_TempCellModule.CopySite(this.m_TempCellModule.GetTplSiteByName(this.ltbTemplate.SelectedItem.ToString())); this.LoadData(); TemplateCellPropertiesFrm frm = new TemplateCellPropertiesFrm(this.m_model, this.m_TempCellModule.TplCellColl, this.m_TempCellModule.NewTemplate, name, this.bListNull); frm.TemplateListCancelEvent -= new TemplateCellPropertiesFrm.TemplateListCancelHandle(this.newPropertiesForm_TemplateListCancelEvent); frm.TemplateListCancelEvent += new TemplateCellPropertiesFrm.TemplateListCancelHandle(this.newPropertiesForm_TemplateListCancelEvent); frm.TemplateListEvent -= new TemplateCellPropertiesFrm.TemplateListChangeHandle(this.newPropertiesForm_TemplateListEvent); frm.TemplateListEvent += new TemplateCellPropertiesFrm.TemplateListChangeHandle(this.newPropertiesForm_TemplateListEvent); frm.ShowDialog(); this.SetBtnDeleteEnable(); } }
private void btnProperties_Click(object sender, EventArgs e) { if (this.ltbTemplate.SelectedItem != null) { SiteTemplate tplSiteByName = this.m_TempCellModule.GetTplSiteByName(this.ltbTemplate.SelectedItem.ToString()); int selectedIndex = this.ltbTemplate.SelectedIndex; TemplateCellPropertiesFrm frm = new TemplateCellPropertiesFrm(this.m_model, this.m_TempCellModule.GetTplSiteByName(this.ltbTemplate.SelectedItem.ToString()), this.m_TempCellModule.TplCellColl); frm.TemplateListEvent -= new TemplateCellPropertiesFrm.TemplateListChangeHandle(this.ProperiesForm_TemplateEvent); frm.TemplateListEvent += new TemplateCellPropertiesFrm.TemplateListChangeHandle(this.ProperiesForm_TemplateEvent); frm.ShowDialog(); this.cmbDefault.SelectedItem = tplSiteByName.Name; this.ltbTemplate.SelectedItem = tplSiteByName.Name; } }