Exemplo n.º 1
0
        /// <summary>
        /// Reacts when port finished work with current connection.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected virtual void OnPortFinished(object sender, EventArgs e)
        {
            IPort port = sender as IPort;

            if (port != null)
            {
                port.FinishedEvent              -= OnPortFinished;
                port.CallCompletedEvent         -= OnCallCompleted;
                port.OnPrepareOutgoingCallEvent -= OnPrepareOutgoingCallEvent;
                port.ClearAllEvents();
                KeyValuePair <ITerminal, IPort> keyValue = _portMapping.FirstOrDefault(kv => kv.Value == port);
                _portMapping.Remove(keyValue);
            }
        }