private void OnConnectionPointSelected(NodePresenter nodePresenter, PortPresenter portPresenter) { if (_selectedNodePresenter != null && _selectedNodePresenter.Id != nodePresenter.Id) { var selectedConnectionPointPresenter = _selectedPointPresenter; var connectionBetweenNodes = new LinkPresenter(new LinkView(), new LinkData()); connectionBetweenNodes.SetFrom(selectedConnectionPointPresenter, _selectedNodePresenter.Id); connectionBetweenNodes.SetTo(portPresenter, nodePresenter.Id); _selectedNodePresenter.AddNextNode(nodePresenter); _connectionPresenters.Add(connectionBetweenNodes); _vntData.AddConnectionData(connectionBetweenNodes.LinkData); _selectedNodePresenter = null; return; } _selectedNodePresenter = nodePresenter; _selectedPointPresenter = portPresenter; }
private void OnConnectionPointSelected(NodePresenter nodePresenter, ConnectionPointPresenter connectionPointPresenter) { if (_selectedNodePresenter != null && _selectedNodePresenter.Id != nodePresenter.Id) { var selectedConnectionPointPresenter = _selectedPointPresenter; var connectionBetweenNodes = new ConnectionPresenter(new ConnectionView(), new ConnectionModel()) { ConnectionPointFrom = selectedConnectionPointPresenter, ConnectionPointTo = connectionPointPresenter }; _selectedNodePresenter.AddNextNode(nodePresenter); _connectionPresenters.Add(connectionBetweenNodes); _selectedNodePresenter = null; return; } _selectedNodePresenter = nodePresenter; _selectedPointPresenter = connectionPointPresenter; }