コード例 #1
0
        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);
        }
コード例 #2
0
 public override bool OnMouseButtonUp(MouseButtonEditorEventArgs args)
 {
     if (args.Button == MouseButton.Left)
     {
         mIsDragging = false;
     }
     else if (args.Button == MouseButton.Right)
     {
         mIsRightButtonDown = false;
     }
     return(true);
 }
コード例 #3
0
        public override bool OnMouseButtonDown(MouseButtonEditorEventArgs args)
        {
            if (previewConnectionPath != null)
            {
                // It's the confirm click, skip this event
                return(true);
            }

            mDragLastPoint = args.Position;

            previewConnectionPath = new ConnectionPath();
            //previewContainer.ContentTemplate = ConnectionTemplate;
            previewConnectionPath.DataContext = new Connection(node, nodeOutput, null, null);
            previewConnectionPath.Brush       = Brushes.SkyBlue;

            nodeEditor.AddPreviewElement(previewConnectionPath);

            mMouseDownTime = DateTime.Now;

            return(true);
        }
コード例 #4
0
        public override bool OnMouseButtonDown(MouseButtonEditorEventArgs args)
        {
            if (args.Button == MouseButton.Left)
            {
                mIsDragging    = true;
                mDragLastPoint = args.Position;

                var mNodeFEToDrag = VisualTreeUtils.HitTestWithDataContext <Node>(nodeEditor, args.Position);
                if (mNodeFEToDrag != null)
                {
                    var node = (Node)mNodeFEToDrag.DataContext;
                    nodeEditor.BeginInteraction(new MoveNodeHandler(nodeEditor, node, mDragLastPoint));
                }
            }
            else if (args.Button == MouseButton.Right)
            {
                mIsRightButtonDown = true;
            }

            return(true);
        }
コード例 #5
0
 public virtual bool OnMouseButtonDown(MouseButtonEditorEventArgs args)
 {
     return(false);
 }
コード例 #6
0
 public virtual bool OnMouseDragStart(MouseButtonEditorEventArgs args)
 {
     return(false);
 }
コード例 #7
0
 public override bool OnMouseButtonUp(MouseButtonEditorEventArgs args)
 {
     nodeEditor.EndInteraction();
     AttachedProps.GetCommandManager(nodeEditor).StartCommand(new MoveNodeCommandToken(null, mNodeToDrag, mNewNodePosition));
     return(true);
 }