protected override void OnMouseDoubleClick(MouseEventArgs e) { base.OnMouseDoubleClick(e); LinkLineNode nodeTest = HitTest(e.X, e.Y); if (nodeTest != null) { nodeTest.SelectLine(true); nodeTest.InsertNode(e.X, e.Y); } }
private void miAddLineNode_Click(object sender, EventArgs e) { MenuItem mi = sender as MenuItem; if (mi != null) { NodeData nd = mi.Tag as NodeData; if (nd != null) { LinkLineNode node = nd.Node; if (node != null) { if (nd.Data != null) { if (nd.Data.GetType().Equals(typeof(Point))) { Point pt = (Point)nd.Data; if (node.Line != null) { UInt32 key2 = node.ActiveDrawingID; LinkLineNode newNode = node.InsertNode(pt.X + 5, pt.Y + 5); if (UndoHost != null) { if (!UndoHost.DisableUndo) { UInt32 key1 = newNode.ActiveDrawingID; UndoEntity entity = new UndoEntity( new LinkLineUndoDelete(UndoHost, key1), new LinkLineUndoAdd(UndoHost, key2, pt)); UndoHost.AddUndoEntity(entity); } } newNode.SaveLocation(); newNode.Selected = true; ActiveDrawing.RefreshControl(this); OnLineNodeAdded(newNode); } } } } } } }
protected override void OnApply(LinkLineNode node) { node.InsertNode(_point.X, _point.Y); }