Exemplo n.º 1
0
        public static void StartPhoneAction(String numberOrEmail, PhoneActions phoneAction)
        {
            switch (phoneAction)
            {
            case PhoneActions.Call:
                Device.OpenUri(new Uri(String.Format("tel:{0}", numberOrEmail)));
                break;

            case PhoneActions.SMS:
                Device.OpenUri(new Uri(String.Format("smsto:{0}", numberOrEmail)));
                break;

            case PhoneActions.Mail:
                Device.OpenUri(new Uri(String.Format("mailto:{0}", numberOrEmail)));
                break;
            }
        }
Exemplo n.º 2
0
        void SetButtonsStatus(PhoneActions button)
        {
            switch (button) {
                case PhoneActions.Login:
                    btnCall.Enabled = true;
                    //btnRecord.Enabled = false;
                    //btnHold.Enabled = false;
                    btnAnswer.Enabled = true;
                    //btnRelease.Enabled = true;
                    //btnMute.Enabled = false;
                    //keyPad.Enabled=false;
                    break;
                case PhoneActions.Logout:
                    btnCall.Enabled = false;
                    //btnRecord.Enabled = false;
                    //btnHold.Enabled = false;
                    btnAnswer.Enabled = false;
                    //btnRelease.Enabled = false;
                    //btnMute.Enabled = false;
                    //keyPad.Enabled=false;
                    break;
                case PhoneActions.Call:
                case PhoneActions.Answer:
                    btnCall.Enabled = false;
                    btnRecord.Enabled = true;
                    btnHold.Enabled = true;
                    btnAnswer.Enabled = false;
                    btnRelease.Enabled = true;
                    btnMute.Enabled = true;
                    keyPad.Enabled=true;
                    break;
                case PhoneActions.Hangup:
                    btnCall.Enabled = true;
                    btnRecord.Enabled = false;
                    btnHold.Enabled = false;
                    btnAnswer.Enabled = true;
                    btnRelease.Enabled = false;
                    btnMute.Enabled = false;
                    keyPad.Enabled=false;
                    break;
                case PhoneActions.ShowKeypad:
                    keyPad.Visible=!keyPad.Visible;
                    break;

            }
        }