Beispiel #1
0
        internal void ConnectPipeModel(IDataPipe pipe, IOutputDataPort srcPort, IInputDataPort destPort)
        {
            IDataPlumber plumber = null;
            using (PlumberFactory pf = new PlumberFactory())
            {
                plumber = pf.CreateDataPlumber();
            }

            plumber.DataPipe = pipe;
            plumber.SetInitialPort(srcPort);
            plumber.SetFinalPort(destPort);
            bool result = plumber.Connect();

            // TODO log connection results.
            if (!result)
            {
                throw new InvalidOperationException("The pipe could not be connected");
            }
        }
Beispiel #2
0
 public void Reset()
 {
     _outputPort = null;
     _inputPort = null;
     _pipe = null;
 }
Beispiel #3
0
 public void InputConnecting_DummyHandler(IInputDataPort sender, ConnectionChangingEventArgs ea)
 {
     InputConnecting_TimesCalled++;
     RecievedEventArgs = ea;
     RecievedSender = sender;
 }
Beispiel #4
0
 public void SetInitialPort(IInputDataPort port)
 {
     DestinationDataPort = port;
     InitialPort = DestinationDataPort;
     if (IsInitialPortSet)
         OnInitialPortSet(new PortSetEventArgs(DestinationDataPort, true));
 }
Beispiel #5
0
 public void SetFinalPort(IInputDataPort port)
 {
     if (!IsInitialPortSet)
     {
         ThrowExceptionIfInitPortNotSet();
     }
     else
     {
         DestinationDataPort = port;
         FinalPort = DestinationDataPort;
         if (IsFinalPortSet)
             OnFinalPortSet(new PortSetEventArgs(DestinationDataPort, false));
     }
 }
 public Edge(IOutputDataPort output, IInputDataPort input)
 {
     Output = output.GetPort();
     Input  = input.GetPort();
 }