private void btnAddGlossaryItem_Click(object sender, System.EventArgs e) { frmCreator frm = new frmCreator(this.localizer,this.localizer.GetValue("Globals","GlossaryItem")); if(frm.ShowDialog(this) == DialogResult.OK) { Model model = (Model)this.currentElement; GlossaryItem gi = model.NewGlossaryItem(frm.tbName.Text,defaultGPrefix,model.Glossary.GetNextFreeID()); model.AddGlossaryItem(gi); model.Glossary.Sorted("Name"); this.Cursor = Cursors.WaitCursor; GList.DataBind(); this.Cursor = Cursors.Default; for(int counter = 0; counter < model.Glossary.Count; counter++) { if((string)GList.Items[counter].Tag == gi.UniqueID) { GList.SelectedIndex = counter; } } string sub = "\"" + gi.Name + "\""; sub = sub.Replace(" ","\t"); sub = sub.Replace(".","\v"); HighlightDescriptor hd = new HighlightDescriptor(sub,Color.Green,null,DescriptorType.Word,DescriptorRecognition.WholeWord,true); this.hdc.Add(hd); this.SetModified(true); } frm.Dispose(); }
private void AddUseCase() { frmCreator frm = new frmCreator(this.localizer,this.localizer.GetValue("Globals","UseCase")); if(frm.ShowDialog(this) == DialogResult.OK) { Package owner = null; IdentificableObjectCollection coll = (this.currentElement as IdentificableObjectCollection); if(coll == null) { owner = (Package)this.currentElement; } else { owner = coll.Owner; } UseCase useCase = owner.NewUseCase(frm.tbName.Text,defaultUCPrefix,owner.UseCases.GetNextFreeID()); this.AddElement(useCase,owner,true); } frm.Dispose(); }
private void btnAddStakeholder_Click(object sender, EventArgs e) { frmCreator frm = new frmCreator(this.localizer, this.localizer.GetValue("Globals", "Stakeholder")); if(frm.ShowDialog(this) == DialogResult.OK) { Model model = (Model)this.currentElement; Stakeholder stakeholder = parent.Model.NewStakeholder(frm.tbName.Text, frmMain.defaultSPrefix, parent.Model.Stakeholders.GetNextFreeID()); parent.Model.AddStakeholder(stakeholder); parent.Model.Stakeholders.Sorted("Name"); parent.AddStakeholderHD(stakeholder.Name); this.UpdateView(); for(int counter = 0; counter < parent.Model.Stakeholders.Count; counter++) { if((string)SList.Items[counter].Tag == stakeholder.UniqueID) { SList.SelectedIndex = counter; } } parent.SetModified(true); } frm.Dispose(); }
private void AddPackage() { frmCreator frm = new frmCreator(this.localizer,this.localizer.GetValue("Globals","Package")); if(frm.ShowDialog(this) == DialogResult.OK) { Package owner = (Package)this.currentElement; Package package = owner.NewPackage(frm.tbName.Text,defaultPPrefix,owner.Packages.GetNextFreeID()); this.AddElement(package,owner,true); } frm.Dispose(); }
private void btnAddGlossaryItem_Click(object sender, System.EventArgs e) { frmCreator frm = new frmCreator(this.localizer, this.localizer.GetValue("Globals", "GlossaryItem")); if (frm.ShowDialog(this) == DialogResult.OK) { Model model = (Model)this.currentElement; GlossaryItem gi = parent.Model.NewGlossaryItem(frm.tbName.Text, frmMain.defaultGPrefix, parent.Model.Glossary.GetNextFreeID()); parent.Model.AddGlossaryItem(gi); parent.Model.Glossary.Sorted("Name"); parent.AddGlossaryItemHD(gi.Name); this.UpdateView(); for(int counter = 0; counter < parent.Model.Glossary.Count; counter++) { if((string)GList.Items[counter].Tag == gi.UniqueID) { GList.SelectedIndex = counter; } } parent.SetModified(true); } frm.Dispose(); }