Exemplo n.º 1
0
        /// <summary>
        ///     Adds an execution port to the node
        /// </summary>
        /// <param name="node"></param>
        /// <param name="name"></param>
        /// <param name="porttype"></param>
        /// <param name="text"></param>
        public void AddExecPort(Node node, string name, PortTypes porttype, string text)
        {
            var port = new ExecPort(Host, name, porttype, text, false);

            if (port.PortTypes == PortTypes.Input)
            {
                port.index = InExecPorts.Count;
                InExecPorts.Add(port);
            }
            else
            {
                port.index = OutExecPorts.Count;

                OutExecPorts.Add(port);
            }
            port.ParentNode = this;
        }
Exemplo n.º 2
0
 public ExecutionConnector(VirtualControl host, ExecPort sPort, ExecPort ePort) : base(host, sPort, ePort)
 {
     Host         = host;
     Type         = ConnectorTypes.Execution;
     StartPort    = sPort;
     ePort.Linked = true;
     sPort.Linked = true;
     EndPort      = ePort;
     StartPort.CalcOrigin();
     EndPort.CalcOrigin();
     Sp = PointsCalculator.PortOrigin(StartPort);
     Ep = PointsCalculator.PortOrigin(EndPort);
     Wire.StartPoint = Sp;
     Wire.EndPoint   = Ep;
     Host.Children.Add(Wire);
     sPort.ParentNode.PropertyChanged += ParentNodeOnPropertyChanged;
     ePort.ParentNode.PropertyChanged += ParentNodeOnPropertyChanged;
     Interlocked.Increment(ref StartPort.CountOutConnectors);
     Interlocked.Increment(ref EndPort.CountOutConnectors);
     Wire.ContextMenu = wireMenu();
 }