Ejemplo n.º 1
0
        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);
                }
            }
        }
Ejemplo n.º 2
0
        public override async Task Logout()
        {
            ActiveRecording = null;
            if (Items != null)
            {
                Items.Clear();
                OnPropertyChanged(nameof(ItemsCount));
            }

            SelectedItem = null;

            await base.Logout();
        }
Ejemplo n.º 3
0
 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);
     }
 }
Ejemplo n.º 4
0
        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);
            }
        }
Ejemplo n.º 5
0
        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);
            }
        }
Ejemplo n.º 6
0
 private async void loadDetails(RecordQueueItem item)
 {
     await loadDetailsAsync(item);
 }