예제 #1
0
        //Functions

        public Telephone(TelephoneState initialState, MicrophoneState micstate)
        {
            micState_        = micstate;
            state_           = initialState;
            DigitBtnEvent   += DigitBtnPresed;
            CallBtnEvent    += CallBtnPressed;
            DisconnectEvent += Disconnect;
            MuteBtnEvent    += MuteBtnPressed;
        }
예제 #2
0
        public void HandleMuteBtnPressed(Telephone e)
        {
            TelephoneState state = e.GetState();

            if (state.GetType() == typeof(Connected))
            {
                middleman(e);
            }
            else
            {
                Console.WriteLine("Cannot control mic when not in call");
            }
        }
예제 #3
0
 public void SetState(TelephoneState state)
 {
     state_ = state;
     state_.OnEnter(this);
 }