コード例 #1
0
 public void AnswerCall(object sender, AnsweredCallEvent e)
 {
     OnNotifyStationOfAnsweredOfCall(new AnsweredCallEvent(PhoneNumber)
     {
         CallStartTime = e.CallStartTime
     });
 }
コード例 #2
0
        public void AnswerCall(object sender, AnsweredCallEvent e)
        {
            if (!(sender is IPort receiverPort))
            {
                return;
            }

            var senderPort = CallsWaitingToBeAnswered.FirstOrDefault(x => x.Value == receiverPort).Key;

            if (senderPort == null)
            {
                return;
            }

            DisposeTimer(senderPort);                    // dispose timer because call was answered
            CallsWaitingToBeAnswered.Remove(senderPort); // remove information about call from this specified list

            CallsInProgress.Add(new HeldCallEvent(senderPort.PhoneNumber, receiverPort.PhoneNumber)
            {
                CallStartTime = e.CallStartTime
            });                                   //

            Logger.WriteLine($"{receiverPort.PhoneNumber} answered call from {senderPort.PhoneNumber}");
        }
コード例 #3
0
 private void OnNotifyStationOfAnsweredOfCall(AnsweredCallEvent e)
 {
     NotifyStationOfAnsweredCall?.Invoke(this, e);
 }
コード例 #4
0
 private void OnNotifyPortAboutAnsweredCall(AnsweredCallEvent e)
 {
     NotifyPortAboutAnsweredCall?.Invoke(this, e);
 }