示例#1
0
 /// <summary>
 /// Triggers the ConnectionChanged event.
 /// </summary>
 public virtual void OnConnectionChanged(ConnectionChangedEventArgs ea)
 {
     if (ConnectionChanged != null)
         ConnectionChanged(this, ea);
 }
示例#2
0
 internal override void _outPortMgr_ConnectionChanged(IOutputPortMgr sender, ConnectionChangedEventArgs ea)
 {
     _outPortMgr_ConnectionChanged_TimesCalled++;
 }
示例#3
0
 internal void OutputPort_ConnectionChanged(IOutputPort sender, ConnectionChangedEventArgs ea)
 {
     if (sender == null)
         return;
     OnConnectionChanged(ea);
 }
示例#4
0
 public void ConnectionChanged_DummyHandler(IInputPortMgr sender, ConnectionChangedEventArgs ea)
 {
     ConnectionChanged_TimesCalled++;
     RecievedEventArgs = ea;
     RecievedSender = sender;
 }
示例#5
0
 public void ConnectionChanged_DummyHandler(IOutputNetworkPort sender, ConnectionChangedEventArgs ea)
 {
     ConnectionChanged_TimesCalled++;
     RecievedEventArgs = ea;
     RecievedSender = sender;
 }
示例#6
0
 public void InputConnected_DummyHandler(IInputNeutralPort sender, ConnectionChangedEventArgs ea)
 {
     InputConnected_TimesCalled++;
     RecievedEventArgs = ea;
     RecievedSender = sender;
 }
示例#7
0
 internal void _outPortMgr_ConnectionChanged(IOutputPortMgr sender, ConnectionChangedEventArgs ea)
 {
     // Do nothing here since there is no need to change the status of the element;
     // (used to throw a NotImplementedException here but it interfered with testing compound elements).
 }
示例#8
0
 internal void _inPortMgr_ConnectionChanged(IInputPortMgr sender, ConnectionChangedEventArgs ea)
 {
     if (sender != null)
     {
         if (ea.Action != ConnectionAction.None)
         {
             // in all cases, the element state will go to incomplete.  All cases should be set to
             // incomplete by the _inPortMgr_ConnectionChanging handler, we do it here also for
             // consistency
             SetStatus(ElementStatus.Incomplete, StatusChangeDriver.NormalTransition, null);
         }
     }
 }
示例#9
0
 internal void InputPort_ConnectionChanged(IInputPort sender, ConnectionChangedEventArgs ea)
 {
     if (sender == null)
         return;
     // this input mgr becomes the new sender for the next level up
     OnConnectionChanged(ea);
 }
示例#10
0
 internal virtual void _outPortMgr_ConnectionChanged(IOutputPortMgr sender, ConnectionChangedEventArgs ea)
 {
     throw new NotImplementedException("The method or operation is not implemented.");
 }
        public void OutputPortMgrConnectionChangedEventHandlerUpdatesElementStateToIncompleteWhenActionIsReplace()
        {
            ElementStatus expectedStatus = ElementStatus.Incomplete;
            ConnectionAction action = ConnectionAction.Replace;
            ConnectionChangedEventArgs args = new ConnectionChangedEventArgs(action);
            var mockOutPortMgr = new Mock<IOutputPortMgr>();
            _el._outPortMgr_ConnectionChanged(mockOutPortMgr, args);

            ElementStatus actualStatus = _el.Status;

            Assert.Equal(expectedStatus, actualStatus);
        }