コード例 #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;
        }
コード例 #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;
        }
コード例 #3
0
ファイル: Pin.cs プロジェクト: idursun/StateMachines
 protected bool Equals(Pin other)
 {
     return Equals(Node, other.Node) && string.Equals(Name, other.Name);
 }
コード例 #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;
     }
 }