private void CaptureConnections(Box box, out BoxHandle[] connections)
 {
     connections = new BoxHandle[box.Connections.Count];
     for (int i = 0; i < connections.Length; i++)
     {
         var other = box.Connections[i];
         connections[i] = new BoxHandle(other);
     }
 }
        public ConnectBoxesAction(InputBox iB, OutputBox oB, bool connect)
        {
            _surface = iB.Surface;
            _context = new ContextHandle(iB.ParentNode.Context);
            _connect = connect;

            _input  = new BoxHandle(iB);
            _output = new BoxHandle(oB);

            CaptureConnections(iB, out _inputBefore);
            CaptureConnections(oB, out _outputBefore);
        }
Beispiel #3
0
        private void CaptureConnections(SurfaceNode node, out BoxHandle[][] boxesConnections)
        {
            var boxes = node.GetBoxes();

            boxesConnections = new BoxHandle[boxes.Count][];
            for (int i = 0; i < boxesConnections.Length; i++)
            {
                var box         = boxes[i];
                var connections = new BoxHandle[box.Connections.Count];
                boxesConnections[i] = connections;
                for (int j = 0; j < connections.Length; j++)
                {
                    var other = box.Connections[j];
                    connections[j] = new BoxHandle(other);
                }
            }
        }