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; }
void Handle_Clicked(object sender, System.EventArgs e) { var request = new BaseInterpreterApiRequest() { CallId = EntryCallId.Text }; var service = new InterpreterService(); service.CancelCall(request); }
private void OnAppCrashInterpreter() { var request = new BaseInterpreterApiRequest() { CallId = ActiveCallRequest.CallId }; var syncService = new SyncService(); syncService.Post(PauseCallInterpreterAPI, request); }
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(); }
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(); } }
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); }
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; } }