コード例 #1
0
 protected virtual void PortOnSendRejectMessageToTerminal(object sender, AnswerEventArgs e)
 {
     if (Number == e.number2)
     {
         TerminalSendMessage?.Invoke(this, e.message);
     }
 }
コード例 #2
0
        protected virtual void PortOnCallAccepted(object sender, AnswerEventArgs e)
        {
            var port1 = ActivePorts.FirstOrDefault(x => x.Key.Number == e.number1).Key;
            var port2 = EnabledPorts.FirstOrDefault(x => x.Number == e.number2);

            AnswerOnAccept?.Invoke(this, new ConnectionEventArgs(port1, port2, e.message));
        }
コード例 #3
0
        //methods-handlers of port events

        protected virtual void PortOnCallRequesting(object sender, AnswerEventArgs e)
        {
            TerminalRequiredAnswer?.Invoke(this, "Incoming call. Type 'y' to answer, 'n' to reject");
            if (_userAnswer != null && _userAnswer.ToLower().Equals("y"))
            {
                AcceptCall?.Invoke(this, new AnswerEventArgs(e.number1, e.number2, $"User 2 : Connection with {e.number1} established"));
            }
            else
            {
                RejectCall?.Invoke(this, new AnswerEventArgs(e.number1, e.number2, $"{e.number2} has rejected call"));
            }
        }
コード例 #4
0
ファイル: Port.cs プロジェクト: ArseniBarsegyan/EPAM_training
 protected virtual void TerminalOnRejectCall(object sender, AnswerEventArgs e)
 {
     CallRejected?.Invoke(this, e);
 }
コード例 #5
0
        protected virtual void PortOnCallRejected(object sender, AnswerEventArgs e)
        {
            var port1 = ActivePorts.FirstOrDefault(x => x.Key.Number == e.number1).Key;

            AnswerOnReject?.Invoke(port1, e.message);
        }