private void RewireNodes(Diagram diagram, IEnumerable <WireState> storedWiringInformation) { foreach (var wireState in storedWiringInformation) { var wireCommand = new WireToTerminalCommand(diagram, wireState.SinkTerminal); wireCommand.Execute(wireState.SourceTerminal); } }
private void CreateInputs(Diagram diagram, Diagram outerDiagram, IEnumerable <WireState> inputWireStates, DiagramNode diagramNode) { foreach (var inputWireState in inputWireStates) { var inputNode = _nodeProvider.CreateNodeFromName(typeof(DiagramInputNode).FullName) as DiagramInputNode; inputNode.X = inputWireState.SourceTerminal.ParentNode.X; inputNode.Y = inputWireState.SourceTerminal.ParentNode.Y; diagram.AddNode(inputNode); var wireCommand = new WireToTerminalCommand(diagram, inputNode.Terminals.First().Model); wireCommand.Execute(inputWireState.SinkTerminal); var newDiagramNodeTerminal = diagramNode.Terminals.Last().Model; wireCommand = new WireToTerminalCommand(outerDiagram, newDiagramNodeTerminal); wireCommand.Execute(inputWireState.SourceTerminal); } }
private static void WireTwoTerminalsOnDiagram(Diagram diagram, Terminal startTerminal, Terminal endTerminal, ITransactor transactor, bool animateWire) { var wireToTerminalCommand = new WireToTerminalCommand(diagram, startTerminal.Model, animateWire); transactor.Transact(wireToTerminalCommand, endTerminal.Model); }