Esempio n. 1
0
        //-------------------------------------------------------------------------------------------------------------------
        // Подписки
        // Станция
        protected void PortAddedToApe(object sender, PortEventArgs e)
        {
            IPhoneExchange phoneExchange = sender as IPhoneExchange;

            if (phoneExchange != null && e != null && e.Port == this)
            {
                //Debug.WriteLine("[Port.PortAddedToApe] PortId: {0}", e.Port.PortId);

                phoneExchange.PortAdded    -= PortAddedToApe;
                phoneExchange.PortRemoved  += PortRemovedFromApe;
                phoneExchange.CallStarted  += IncommingCallReceived;
                phoneExchange.CallEnded    += IncommingCallEnded;
                phoneExchange.CallAccepted += OutgoingCallAccepted;
            }
        }
Esempio n. 2
0
        public Port(IPhoneExchange phoneExchange, IPortId portId)
        {
            if (phoneExchange == null)
            {
                throw new ArgumentNullException("phoneExchange", "phoneExchange cannot be null.");
            }
            if (portId == null)
            {
                throw new ArgumentNullException("portId", "portId cannot be null.");
            }

            PortId    = portId;
            PortState = PortStates.NotConnected;

            phoneExchange.PortAdded += PortAddedToApe;
        }
Esempio n. 3
0
 public IPort CreatePort(IPhoneExchange phoneExchange, IPortId portId)
 {
     return(new Port(phoneExchange, portId));
 }