Пример #1
0
        public void TakeIncomingCall(object sender, CallEvent e)
        {
            noAnswer = false;
            id       = e.Id;
            Console.WriteLine("   Call from {0} to {1}", e.TelephoneNumber, e.TargetTelephoneNumber);
            Console.WriteLine("   Answer? Y/N");
lable1:
            char key = Console.ReadKey().KeyChar;

            if (key == 'Y' || key == 'y')
            {
                AnswerToCall(e.TelephoneNumber, CallStatus.Answered, e.Id);
            }
            else if (key == 'N' || key == 'n')
            {
                Console.WriteLine();
                noAnswer = true;
                EndCall();
            }
            else
            {
                Console.WriteLine("  Wrong key, repeat input:");
                goto lable1;
            }
        }
Пример #2
0
 private void CallingTo(object sender, CallEvent e)
 {
     CallingToEvent(e.TelephoneNumber, e.TargetTelephoneNumber);
 }
Пример #3
0
 protected virtual void CallingToEvent(int number, int targetNumber)
 {
     CallEvent?.Invoke(this, new CallEvent(number, targetNumber));
 }
Пример #4
0
 protected virtual void UpCallEvent(int targetNumber)
 {
     CallEvent?.Invoke(this, new CallEvent(phoneNumber, targetNumber));
 }