/// <summary> /// Tries to detach the given handler /// </summary> /// <param name="th">The handler to detach</param> public void DetachHandler(TrafficHandlerPort th) { if (HandlerDetaching != null) { CanAttach = HandlerDetaching(this, th); HandlerDetached(this, th); } }
/// <summary> /// Checks whether this port is connected to the given port. /// </summary> /// <param name="th">The port to check the connection with.</param> /// <returns>A bool indicating whether this port is connected to the given port.</returns> public bool IsConnectedTo(TrafficHandlerPort th) { if (HandlerStatusCallback != null) { return(HandlerStatusCallback(this, th)); } else { throw new NotImplementedException("Ports status query failed. The HandlerStatusCallback event was not overloaded by the HandlerController which created this port"); } }
/// <summary> /// Creates a new instance of this class. /// </summary> /// <param name="pAlice">The first port this link is connected to</param> /// <param name="pBob">The second port this link is connected to</param> public Link(TrafficHandlerPort pAlice, TrafficHandlerPort pBob) { this.Alice = pAlice; this.Bob = pBob; }