private void mnNewMotif_Click(object sender, EventArgs e) { Forms.EditMotifForm emf = new Forms.EditMotifForm(new Motif(), this.controller); if (emf.ShowDialog() == DialogResult.OK) { Motif m2 = emf.editedMotif; string name = controller.generateDefaultMotifName("motif"); m2.setName(name); ProgramAction action = new CreateMotifAction(this.controller, m2); this.controller.executeAction(action); controller.treeview_selectNode(m2); } }
private void mcmEditMotif_Click(object sender, EventArgs e) { Motif m = controller.getMotifFromName(this.motifTreeView.SelectedNode.Text); Forms.EditMotifForm emf = new Forms.EditMotifForm(m, this.controller); if (emf.ShowDialog() == DialogResult.OK) { Motif m2 = emf.editedMotif; m2.setVariation(new NullVariation(), m.getId()); string name = controller.generateDefaultMotifName(m.getName() + "_edited"); m2.setName(name); ProgramAction action = new CreateMotifAction(this.controller, m2); this.controller.executeAction(action); controller.treeview_selectNode(m2); } }