public void MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { if (BeginEllips.IsVisible(e.Location)) { FlagVisible = 1; } else if (EndEllips.IsVisible(e.Location)) { FlagVisible = 2; } else if (PathLine.IsOutlineVisible(e.Location, pen)) { FlagVisible = 3; } if (FlagVisible != 0) { LastLocation = e.Location; } } else if (e.Button == MouseButtons.Right && PathLine.IsOutlineVisible(e.Location, pen)) { if (calculate != null) { calculate.RemoveVariable(this); } if (RemoveEdge != null) { RemoveEdge(this); ((Control)sender).Invalidate(); } } }
void MoveValueElement(Object sender, Point Delta) { BeginPoint = Delta; BeginEllips.Reset(); BeginEllips.AddEllipse(BeginPoint.X - 10, BeginPoint.Y - 10, 20, 20); PathLine.Reset(); PathLine.AddLine(BeginPoint, EndPoint); ((Control)sender).Parent.Invalidate(); }