public void SetMouseCursor(uint nodeId, NodePart nodePart, int index, ModifierKeys modifiers, bool isMouseButtonDown, double x, double y) { if (0 == nodeId) { // When the UI calls this method, we are only expecting two possible // value ranges for 'nodeId': a "uint.MaxValue" when the 'nodeId' is // invalid, or a positive number. This should not be zero, if it is, // do let me know. - Ben. throw new ArgumentException("121B20BE: Invalid argument!", "nodeId"); } if (currentDragState == DragState.NodeRepositioning) { if (!isMouseButtonDown) { return; } foreach (DraggedNode draggedNode in dragSet) { if (visualHost != null) { VisualNode node = (VisualNode)draggedNode.node; DrawingVisual visual = visualHost.GetDrawingVisualForNode(node.NodeId); TranslateTransform transform = visual.Transform as TranslateTransform; transform.X = x - draggedNode.DeltaX; transform.Y = y - draggedNode.DeltaY; node.X = transform.X; node.Y = transform.Y; this.TransformBubble(node, transform); } } edgeController.UpdateSelectedEdges(); selectionBox.UpdateSelectionBox(x, y); } else if ((currentDragState == DragState.CurveDrawing) || (currentDragState == DragState.EdgeReconnection)) { if (nodePart != NodePart.None && nodeId == uint.MaxValue) { throw new InvalidOperationException("Nodepard and NodeId are not in consistent (914C54A64BFD)"); } VisualNode node = null; edgeConnection = EdgeConnectionFlag.None; if (nodePart != NodePart.None) { node = GetVisualNode(nodeId); } else { if (lastHoveredNodeId != uint.MaxValue && lastHoveredNodeId != edgeController.GetCurrentlySelectedNodeId()) { node = GetVisualNode(lastHoveredNodeId); node.PreviewSelected = node.Selected;//reset the original state of the node RearrangeNodeAndBubbleVisual(node, false); } } //verification List <IVisualNode> nodeToModify; edgeConnection = edgeController.AttemptConnectEdge(node, nodePart, index, out nodeToModify); if (nodePart != NodePart.None) { if ((edgeConnection == EdgeConnectionFlag.NewEdge || edgeConnection == EdgeConnectionFlag.ReconnectEdge) && (nodePart == NodePart.InputSlot || nodePart == NodePart.InputLabel || nodePart == NodePart.ReplicationGuide)) { node.SetHoveredIndex(index); } node.PreviewSelected = true; RearrangeNodeAndBubbleVisual(node, true); } if (edgeConnection != EdgeConnectionFlag.None && edgeConnection != EdgeConnectionFlag.Illegal) { edgeController.DrawConnectingEdgeTo(); } else { edgeController.DrawConnectingEdgeTo(new Point(x, y)); } lastHoveredNodeId = nodeId; if (null != node) { node.Compose(); // Optionally redraw the node. } } }