private void RestoreConnections(MyNode node, Dictionary <MyNode, MyNodeView> nodeViewTable) { MyNodeView toNodeView = nodeViewTable[node]; for (int i = 0; i < node.InputBranches; i++) { MyConnection connection = node.InputConnections[i]; if (connection != null) { MyNodeView fromNodeView = nodeViewTable[connection.From]; NodeItem fromNodeViewItem = fromNodeView.GetOuputBranchItem(connection.FromIndex); NodeConnection c = Desktop.Connect(fromNodeViewItem, toNodeView.GetInputBranchItem(connection.ToIndex)); c.Tag = connection; } } }
private void RestoreConnections(MyNode node, Dictionary <MyNode, MyNodeView> nodeViewTable) { MyNodeView toNodeView = nodeViewTable[node]; for (int i = 0; i < node.InputBranches; i++) { MyConnection connection = node.InputConnections[i]; if (connection != null) { MyNodeView fromNodeView = nodeViewTable[connection.From]; NodeItem fromNodeViewItem = fromNodeView.GetOuputBranchItem(connection.FromIndex); MyNodeViewConnection c = Desktop.Connect(fromNodeViewItem, toNodeView.GetInputBranchItem(connection.ToIndex)) as MyNodeViewConnection; Debug.Assert(c != null, "Invalid connection factory delegate"); c.Tag = connection; c.Hidden = connection.IsHidden; } } }