Example #1
0
        public Terminal(PhoneNumber PhoneNumber)
        {
            this.PhoneNumber = PhoneNumber;

            this.Online += (sender, e) => { Console.WriteLine("Terminal {0} turned to online mode!", this.PhoneNumber); };
            this.OffLine += (sender, e) => { Console.WriteLine("Terminal {0} turned to offline mode!", this.PhoneNumber); };

            this.IncomingRequest += (sender, e) => { Console.WriteLine("Terminal {0} received request from {1}!", this.PhoneNumber, (e.Request as IncomingRequest).Source); };
        }
Example #2
0
 public Response(ResponseState state, PhoneNumber source)
 {
     State = state;
     Source = source;
 }
Example #3
0
        protected void SetPortStateAfterConnectionInterrupted(PhoneNumber Source, PhoneNumber target)
        {
            IPort SourcePort = GetPortByNumber(Source);

            if (SourcePort != null)
                SourcePort.State = PortState.Free;

            IPort targetPort = GetPortByNumber(target);

            if (targetPort != null)
                targetPort.State = PortState.Free;
        }
Example #4
0
 protected ITerminal GetTerminalByNumber(PhoneNumber PhoneNumber)
 {
     return this.m_terminals.FirstOrDefault(x => x.PhoneNumber == PhoneNumber);
 }
Example #5
0
 protected IPort GetPortByNumber(PhoneNumber PhoneNumber)
 {
     return this.m_portMapping[PhoneNumber];
 }
Example #6
0
 protected CallInfo GetConnectionInfo(PhoneNumber PhoneNumber)
 {
     return this.m_connectionCollection.FirstOrDefault(x => (x.Source == PhoneNumber || x.Target == PhoneNumber));
 }
Example #7
0
 protected bool CheckOnCorrectness(PhoneNumber Source, PhoneNumber target)
 {
     return (Source != default(PhoneNumber) && target != default(PhoneNumber));
 }
Example #8
0
 public CallInfo(PhoneNumber source, PhoneNumber target, DateTime start, TimeSpan duration)
     : this(source, target, start)
 {
     this.Duration = duration;
 }
Example #9
0
 public CallInfo(PhoneNumber source, PhoneNumber target, DateTime start)
 {
     this.Source = source;
     this.Target = target;
     this.Started = start;
 }
Example #10
0
 public CallInfo(PhoneNumber target, PhoneNumber source, TerminalState state)
 {
     Target = target;
     Source = source;
     State = state;
 }
Example #11
0
        public void Call(PhoneNumber target)
        {
            if (!IsOnline)
                OnOutgoingRequest(this, target);

            if (m_serverRequest != null)
                OnOnline(this, EventArgs.Empty);
        }
Example #12
0
 protected virtual void OnOutgoingRequest(object sender, PhoneNumber target)
 {
     if (OutgoingConnection != null)
     {
         this.m_serverRequest = new OutgoingRequest(this.PhoneNumber, target);
         OutgoingConnection(sender, new RequestEventArgs(this.m_serverRequest));
     }
 }
Example #13
0
 public void IncomingRequestFrom(PhoneNumber Source)
 {
     OnIncomingRequest(this, new IncomingRequest(Source));
 }