void OnConnectionRemoved(object sender, NodeConnectionEventArgs e)
        {
            MyConnection connToDelete = e.Connection.Tag as MyConnection;

            if (connToDelete != null)
            {
                connToDelete.Disconnect();
            }
        }
        void OnConnectionRemoved(object sender, NodeConnectionEventArgs e)
        {
            MyConnection connToDelete = e.Connection.Tag as MyConnection;

            if (connToDelete != null)
            {
                connToDelete.Disconnect();

                m_mainForm.ProjectStateChanged("Connection removed");
            }

            m_mainForm.RefreshConnections(this);
        }
        private void DisconnectInputNodesFromEnd(int fromIndex)
        {
            if (Children != null)
            {
                foreach (MyNode child in Children)
                {
                    for (int i = 0; i < child.InputConnections.Length; i++)
                    {
                        MyConnection c = child.InputConnections[i];

                        if (c != null &&
                            c.From is MyParentInput &&
                            (c.From as MyParentInput).ParentInputIndex >= fromIndex)
                        {
                            c.Disconnect();
                            child.InputConnections[i] = null;
                        }
                    }
                }
            }

            if (GroupInputNodes != null)
            {
                foreach (MyOutput outputNode in GroupOutputNodes)
                {
                    if (outputNode != null &&
                        outputNode.InputConnections[0] != null &&
                        outputNode.InputConnections[0].From is MyParentInput &&
                        (outputNode.InputConnections[0].From as MyParentInput).ParentInputIndex >= fromIndex)
                    {
                        outputNode.InputConnections[0].Disconnect();
                        outputNode.InputConnections[0] = null;
                    }
                }
            }
        }
Exemple #4
0
 public void Disconnects()
 {
     m_connection.Disconnect();
     Assert.Empty(m_node1.OutputConnections[0]);
     Assert.Null(m_node2.InputConnections[0]);
 }