Beispiel #1
0
 public void SetInitialPort(IInputNetworkPort port)
 {
     DestinationNetworkPort = port;
     InitialPort = DestinationNetworkPort;
     if (IsInitialPortSet)
         OnInitialPortSet(new PortSetEventArgs(DestinationNetworkPort, true));
 }
Beispiel #2
0
 public void SetFinalPort(IInputNetworkPort port)
 {
     if (!IsInitialPortSet)
     {
         ThrowExceptionIfInitPortNotSet();
     }
     else
     {
         DestinationNetworkPort = port;
         FinalPort = DestinationNetworkPort;
         if (IsFinalPortSet)
             OnFinalPortSet(new PortSetEventArgs(DestinationNetworkPort, false));
     }
 }
Beispiel #3
0
 public void Reset()
 {
     _outputPort = null;
     _inputPort = null;
     _pipe = null;
 }
Beispiel #4
0
        internal void ConnectPipeModel(INetworkPipe pipe, IOutputNetworkPort srcPort, IInputNetworkPort destPort)
        {
            INetworkPlumber plumber = null;
            using (PlumberFactory pf = new PlumberFactory())
            {
                plumber = pf.CreateNetworkPlumber();
            }

            plumber.NetworkPipe = 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 #5
0
 public void InputConnecting_DummyHandler(IInputNetworkPort sender, ConnectionChangingEventArgs ea)
 {
     InputConnecting_TimesCalled++;
     RecievedEventArgs = ea;
     RecievedSender = sender;
 }