Beispiel #1
0
 public void OnEndedCall(object sender, EndCallEventArgs e)
 {
     if (State == PortStates.Calling)
     {
         e.Id = CallId;
         Reset();
         Console.WriteLine($"Port {Terminal.PhoneNumber} got response about the end of the call from {e.SourcePhoneNumber}");
         EndCallEvent?.Invoke(this, e);
     }
 }
Beispiel #2
0
        public void HandleEndCallEvent(object o, EndCallEventArgs e)
        {
            var item = OnGoingCalls.Find(x => e.InitiatorOfEnd == x.Caller || e.InitiatorOfEnd == x.Receiver);

            if (item != null)
            {
                item.SetTimeOfEnd(e.TimeOfEndCall);
                Abonents.FinishedCalls.Add(item);
                e.SetEndedCall(item);
                OnGoingCalls.Remove(item);
                item.Caller.ChangeCallStatus(StatusOfCall.Avaliable);
                item.Receiver.ChangeCallStatus(StatusOfCall.Avaliable);
            }
        }
Beispiel #3
0
 public void HandleEndCallEvent(object o, EndCallEventArgs e)
 {
     OnEndingCall(e);
 }
Beispiel #4
0
 protected virtual void OnEndingCall(EndCallEventArgs e)
 {
     EndingCall.Invoke(this, e);
 }
Beispiel #5
0
 private void EndCall(object sender, EndCallEventArgs e)
 {
     RaiseEndCallEvent(e.Id, e.TelephoneNumber);
 }
Beispiel #6
0
 public void HandleCostOfCall(object o, EndCallEventArgs e)
 {
     Payment += e.EndedCall.GetDuretionOfCall().TotalSeconds *Tariff.Cost;
 }
Beispiel #7
0
 void terminal_EndCallEvent(object sender, EndCallEventArgs e)
 {
     OnEndCallEvent(e.PhoneNumber);
 }