public override void StopInteraction(DiagramInteractionEventArguments interaction) { var diagram = interaction.Diagram; var left = diagram.GetDiagramPointFromViewPointX(X); var top = diagram.GetDiagramPointFromViewPointY(Y); var right = diagram.GetDiagramPointFromViewPointX(X + Width); var bottom = diagram.GetDiagramPointFromViewPointY(Y + Height); var nodesToWire = diagram.Nodes.Where(node => node.X > left && node.X + node.Width <right && node.Y> top && node.Y + node.Height < bottom).ToList(); var autoWirer = new NodeAutoWirer(); autoWirer.AutoWireNodes(diagram, nodesToWire); }
/// <summary> /// Begin inserting a node onto the diagram. /// </summary> /// <param name="node">The node to insert.</param> /// <param name="insertCopy">Whether to insert a copy of <see cref="node"/>.</param> public void BeginInsertingNode(Node node, bool insertCopy = false) { var nodeTypeName = node.GetType().FullName; var nodeToInsert = insertCopy ? _nodeProvider.CreateNodeFromName(nodeTypeName) : node; nodeToInsert.Visible = false; nodeToInsert.Model.X = _diagram.GetDiagramPointFromViewPointX(X); nodeToInsert.Model.Y = _diagram.GetDiagramPointFromViewPointX(Y); _diagram.AddNodeInteractively(nodeToInsert); if (ContextTerminal != null) { var autoWirer = new NodeAutoWirer(); autoWirer.TryAutoWireTerminals(_diagram, ContextTerminal, nodeToInsert); } ContextTerminal = null; }