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; }
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; }
protected bool Equals(Pin other) { return Equals(Node, other.Node) && string.Equals(Name, other.Name); }
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; } }