public void AddConnection(ConnectionGUI connection, bool twoWay) { AddAssociation(connection.startNode, connection); if (twoWay) { AddAssociation(connection.endNode, connection); } connectionList.Add(connection); }
public void SelectConnection(ConnectionGUI connection) { foreach (var item in connectionList) { item.SetInactive(); } if (connection != null) { connection.SetActive(); } }
private void AddAssociation(NodeGUI node, ConnectionGUI connection) { if (node == null) { return; } if (!nodeToConnectionMap.ContainsKey(node)) { // add it nodeToConnectionMap.Add(node, new List <ConnectionGUI>()); } nodeToConnectionMap[node].Add(connection); }
public ConnectionGUI CreateConnection() { var connection = new ConnectionGUI(); return(connection); }