private async Task delete(RecordQueueItem item) { if (await Application.Current.MainPage.DisplayAlert("Delete Recording", "Are you sure you want to delete the selected video?", "Yes", "No")) { try { var response = await QueueClient.Delete(item.ID); if ((response != null) && response.Success) { Items.Remove(item); OnPropertyChanged(nameof(ItemsCount)); if (item.Equals(SelectedItem)) { SelectedItem = null; } await accountViewModel.FetchUserCreditsAsync(); await Application.Current.MainPage.DisplayAlert("Recording Deleted", "The video has been successfully deleted.", "OK"); } else if (response != null) { await Application.Current.MainPage.DisplayAlert("Delete Recording", response.ErrorMessageClean, "OK"); } } catch (Exception ex) { //XXX : Handle error LoggerService.Instance.Log("ERROR: Queue.delete: " + ex); } } }
public override async Task Logout() { ActiveRecording = null; if (Items != null) { Items.Clear(); OnPropertyChanged(nameof(ItemsCount)); } SelectedItem = null; await base.Logout(); }
private async Task moveToBottom(RecordQueueItem item) { try { var sourceIndex = Items.IndexOf(item); var destinationIndex = Items.Count - 1; await move(sourceIndex, destinationIndex); } catch (Exception ex) { //XXX : Handle error LoggerService.Instance.Log("ERROR: Queue.moveToBottom: " + ex); } }
private async Task loadStatusAsync(RecordQueueItem item) { try { item.RecordingProgress = await QueueClient.GetStatus(item.ID); if (item.RecordingProgress != null) { item.RecordingStatus = item.RecordingProgress.Status; } } catch (Exception ex) { //XXX : Handle error LoggerService.Instance.Log("ERROR: Queue.loadStatusAsync: " + ex); } }
private async Task loadDetailsAsync(RecordQueueItem item) { try { var details = await QueueClient.Get(item.ID); if (details != null) { item.UpdateFromDetails(details); } } catch (Exception ex) { //XXX : Handle error LoggerService.Instance.Log("ERROR: Queue.loadDetailsAsync: " + ex); } }
private async void loadDetails(RecordQueueItem item) { await loadDetailsAsync(item); }