public override bool OnMouseButtonUp(MouseButtonEditorEventArgs args)
        {
            var wasFirstClick = firstClick;

            firstClick = false;

            if (DateTime.Now.Subtract(mMouseDownTime).TotalSeconds < 1)
            {
                // It's a click, if it's the first click do not confirm.
                if (wasFirstClick)
                {
                    return(true);
                }
            }

            // Launch the command
            if (toNode != null && toNodeInput != null)
            {
                var connection = new Connection(node, nodeOutput, toNode, toNodeInput);
                AttachedProps.GetCommandManager(nodeEditor).StartCommand(new AddConnectionCommandToken(null, connection));
            }

            removeAdorner();
            nodeEditor.EndInteraction();
            return(true);
        }
Ejemplo n.º 2
0
 public override bool OnMouseButtonUp(MouseButtonEditorEventArgs args)
 {
     nodeEditor.EndInteraction();
     AttachedProps.GetCommandManager(nodeEditor).StartCommand(new MoveNodeCommandToken(null, mNodeToDrag, mNewNodePosition));
     return(true);
 }