Example #1
0
        public void Add <T>(DataPin pinA, DataPin pinB) where T : struct
        {
            if (pinA.IsInputPin == pinB.IsInputPin)
            {
                return;
            }

            OutputPin <T> pOut = (pinA.IsInputPin ? pinB : pinA) as OutputPin <T>;
            InputPin <T>  pIn  = (pinA.IsInputPin ? pinA : pinB) as InputPin <T>;

            foreach (object conn in ConnectionsArray)
            {
                ConnectionEntry <T> ce = conn as ConnectionEntry <T>;
                if ((ce != null) && (ce.AssociatedOutputPin == pOut))
                {
                    ce.AddInput(pIn);
                    return;
                }
            }
            // No output pins were found -  create a new queue
            ConnectionEntry <T> newce = new ConnectionEntry <T>(pOut);

            newce.AddInput(pIn);
            ConnectionsArray.Add(newce);
        }
Example #2
0
        public void Add <T>(OutputPin <T> pinA, InputPin <T> pinB) where T : struct
        {
            foreach (object conn in ConnectionsArray)
            {
                ConnectionEntry <T> ce = conn as ConnectionEntry <T>;
                if ((ce != null) && (ce.AssociatedOutputPin == pinA))
                {
                    ce.AddInput(pinB);
                    return;
                }
            }
            // No output pins were found -  create a new queue
            ConnectionEntry <T> newce = new ConnectionEntry <T>(pinA);

            newce.AddInput(pinB);
            ConnectionsArray.Add(newce);
        }