Exemple #1
0
        public void Do()
        {
            oldFrom         = connection.FromNode;
            oldFromPortName = connection.FromPortName;
            oldTo           = connection.ToNode;
            oldToPortName   = connection.ToPortName;

            replacedConnections.Clear();
            if (connection.FromNodeGUID == newFrom.GUID && connection.FromPortName == newFromPortName)
            {
                if (newTo.Ports[newToPortName].capacity == BasePort.Capacity.Single)
                {
                    replacedConnections.AddRange(newTo.Ports[newToPortName].Connections);
                }
            }
            else
            {
                if (newFrom.Ports[newFromPortName].capacity == BasePort.Capacity.Single)
                {
                    replacedConnections.AddRange(newFrom.Ports[newFromPortName].Connections);
                }
            }

            connection.Redirect(newFrom, newFromPortName, newTo, newToPortName);
            graph.Connect(connection);
        }
Exemple #2
0
        public void Do()
        {
            replacedConnections.Clear();
            if (from.Ports[fromPortName].capacity == BasePort.Capacity.Single)
            {
                foreach (var connection in from.Ports[fromPortName].Connections)
                {
                    replacedConnections.Add(connection);
                }
            }
            if (to.Ports[toPortName].capacity == BasePort.Capacity.Single)
            {
                foreach (var connection in to.Ports[toPortName].Connections)
                {
                    replacedConnections.Add(connection);
                }
            }

            if (connection == null)
            {
                connection = graph.Connect(from, fromPortName, to, toPortName);
            }
            else
            {
                graph.Connect(connection);
            }
        }
Exemple #3
0
 public void Undo()
 {
     graph.AddNode(node);
     foreach (var edge in connections)
     {
         graph.Connect(edge);
     }
     connections.Clear();
 }
Exemple #4
0
 public void Undo()
 {
     graph.Connect(connection);
 }