/// <summary> /// Callback for panel when mouse is up ; used to delete pannels /// </summary> /// <param name="sender">sender</param> /// <param name="e">event args</param> private void MyControl_MouseUp(object sender, MouseEventArgs e) { if (e.Button == System.Windows.Forms.MouseButtons.Right) { CommandPanel commandPanel = (sender as CommandPanel); _programManager.Connections.RemoveElement(commandPanel); panelDrawing.Controls.Remove(commandPanel); _programManager.DrawConnections(_graphics, _myPen); pictureBoxDrawing.Refresh(); } }
public void SetOutRight(CommandPanel outRight) { if (outRight == _in) { MessageBox.Show("You can't bind same block!"); return; } if (_in == null) { this.Connections.BindElementFirst(outRight, _in); _in = null; } }
public bool SetIn(CommandPanel input) { _in = input; if (_outLeft != null && _outRight != _in) { this.Connections.BindElementSecond(_outLeft, _in); _outLeft = null; _outRight = null; _in = null; return(true); } else if (_outRight != null && _outLeft != _in) { this.Connections.BindElementFirst(_outRight, _in); _outLeft = null; _outRight = null; _in = null; return(true); } return(false); }
/// <summary> /// Constructor with parameters /// </summary> /// <param name="start">Start label</param> /// <param name="end">End Label</param> public ProgramManagerCommand(CommandPanel start, CommandPanel end) : base(start, end) { }