コード例 #1
0
        private async Task TogglePauseCallProcedureAsync(object sender, EventArgs e)
        {
            var service = new InterpreterService();
            var request = new BaseInterpreterApiRequest();

            request.CallId = _callId;

            if (_isPaused)
            {
                // unpausing
                await service.UnpauseCall(request);

                timer.Start();
                _timerStarted          = true;
                ((Image)sender).Source = "pause.png";
                //((Button)sender).Text = "Pause";
                BtnEndCall.IsEnabled = true;
            }
            else
            {
                // pausing
                await service.PauseCall(request);

                timer.Stop();
                _timerStarted          = false;
                ((Image)sender).Source = "play.png";
                //((Button)sender).Text = "Unpause";
                BtnEndCall.IsEnabled = false;
            }

            _isPaused = !_isPaused;
        }
コード例 #2
0
        void Handle_Clicked(object sender, System.EventArgs e)
        {
            var request = new BaseInterpreterApiRequest()
            {
                CallId = EntryCallId.Text
            };
            var service = new InterpreterService();

            service.CancelCall(request);
        }
コード例 #3
0
        private void OnAppCrashInterpreter()
        {
            var request = new BaseInterpreterApiRequest()
            {
                CallId = ActiveCallRequest.CallId
            };
            var syncService = new SyncService();

            syncService.Post(PauseCallInterpreterAPI, request);
        }
コード例 #4
0
        private async Task EndCallProcedureAsync(object sender, EventArgs e)
        {
            var service = new InterpreterService();
            var request = new BaseInterpreterApiRequest();

            request.CallId = _callId;
            await service.EndCall(request);

            timer.Stop();
            _timerStarted = false;
            CloseTimerPage();
            RateInterpreterAsync();
        }
コード例 #5
0
        private async Task CancelCallButtonClickedAsync(object sender, EventArgs e)
        {
            var confirmed = await DisplayAlert("Confirmation", "Cancel call?", "Yes", "No");

            if (confirmed)
            {
                var service = new InterpreterService();
                var request = new BaseInterpreterApiRequest();
                request.CallId = _callId;
                await service.CancelCall(request);

                CloseTimerPage();
            }
        }
コード例 #6
0
        public async Task <BaseRespond> UnpauseCall(BaseInterpreterApiRequest requestModel)
        {
            var responce = new BaseRespond();

            try
            {
                responce = await Post <BaseRespond, BaseInterpreterApiRequest>(EndPauseCallInterpreterAPI, requestModel);
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
            }

            return(responce);
        }
コード例 #7
0
        private async Task StartCallProcedureAsync(object sender, EventArgs e)
        {
            var service = new InterpreterService();
            var request = new BaseInterpreterApiRequest();

            request.CallId = _callId;
            await service.StartCall(request);

            SetTimerActive(true);

            if (timer == null)
            {
                timer = new MyTimer(TimeSpan.FromSeconds(1), UpdateTimerLabel);
                timer.Start();
                _timerStarted = true;
            }
            else
            {
                timer.Stop();
                timer.Start();
                _timerStarted = true;
            }
        }