public EditProcDefController NewProcDef(Func <TextBox> textBoxMaker, Button eraseButton) { ProcDefBlock block = new ProcDefBlock(); ProcDefView view = (ProcDefView)viewFactory.ViewFromBlock(block); EditProcDefController controller = new EditProcDefController(view, block, viewFactory, textBoxMaker, eraseButton); return(controller); }
private void defineNewProcToolStripMenuItem_Click(object sender, EventArgs e) { EditProcDefForm form = new EditProcDefForm(); EditProcDefController subController = controller.NewProcDef(() => form.MakeTextBox(), form.GetEraseButton()); form.SetController(subController); form.StartPosition = FormStartPosition.CenterParent; if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK) { controller.DefineNewProc(subController.Model, "My blocks"); } }
public void SetController(EditProcDefController controller) { this.controller = controller; this.controller.Changed += new EditProcDefControllerChangedEvent(controller_Changed); controller.SetGrapics(panel1.CreateGraphics()); }
public void SetController(EditProcDefController controller) { this.controller = controller; this.controller.Changed += new EditProcDefControllerChangedEvent(controller_Changed); controller.SetGrapics(panel1.CreateGraphics()); }
public EditProcDefController NewProcDef(Func<TextBox> textBoxMaker, Button eraseButton) { ProcDefBlock block = new ProcDefBlock(); ProcDefView view = (ProcDefView) viewFactory.ViewFromBlock(block); EditProcDefController controller = new EditProcDefController(view, block, viewFactory, textBoxMaker, eraseButton); return controller; }