Exemplo n.º 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);
        }
Exemplo n.º 2
0
 DataPin[] IDataModule.get_Pins()
 {
     DataPin[] ret = new DataPin[OutputPins.Count + InputPins.Count];
     InputPins.CopyTo(ret, 0);
     OutputPins.CopyTo(ret, InputPins.Count);
     return(ret);
 }