Example #1
0
        public IWorkflowBuilder Connect(Pin pin1, Pin pin2)
        {
            if (pin1 == null) throw new ArgumentNullException("pin1");
            if (pin2 == null) throw new ArgumentNullException("pin2");
            if (!Nodes.Contains(pin1.Node))
            {
                Add(pin1.Node);
            }
            if (!Nodes.Contains(pin2.Node))
            {
                Add(pin2.Node);
            }

            Connections.Add(Tuple.Create(pin1, pin2));
            return this;
        }
Example #2
0
        public IWorkflowBuilder Connect(Pin pin1, IExecutable executable)
        {
            if (pin1 == null) throw new ArgumentNullException("pin1");
            if (executable == null) throw new ArgumentNullException("executable");
            if (!Nodes.Contains(pin1.Node))
            {
                Add(pin1.Node);
            }
            if (!Nodes.Contains(executable as WorkflowNode))
            {
                Add(executable as WorkflowNode);
            }

            FlowConnections.Add(Tuple.Create(pin1, executable));
            return this;
        }
Example #3
0
 protected bool Equals(Pin other)
 {
     return Equals(Node, other.Node) && string.Equals(Name, other.Name);
 }
Example #4
0
 public IEnumerable<Pin> GetConnectedPins(Pin input)
 {
     foreach (var connection in m_connections)
     {
         if (connection.Item1 == input)
             yield return connection.Item2;
         if (connection.Item2 == input)
             yield return connection.Item1;
     }
 }