Exemplo n.º 1
0
 protected async Task <bool> Unarchive(Series series)
 {
     return(await MoveToShelf(series, series.Progress == 0
                              ?Shelf.Unread
                              : series.Progress == 100
                              ?Shelf.Finished
                              : Shelf.PutAside));
 }
        public async Task OnAction(Series series, SeriesAction action)
        {
            var success = await action.ClickAction(series);

            if (success)
            {
                Items.Remove(series);
                StateHasChanged();
            }
        }
Exemplo n.º 3
0
        private async Task <bool> MoveToShelf(Series series, Shelf shelf)
        {
            var success = await _repository.UpdateShelf(series, shelf);

            if (success)
            {
                _messenger.DisplaySuccessAlert($"{series.Title} moved to shelf {shelf}");
            }
            else
            {
                _messenger.DisplayErrorAlert($"An error was encountered moving {series.Title} to shelf {shelf}");
            }

            return(success);
        }
Exemplo n.º 4
0
 protected bool FilterFunc(Series element)
 {
     if (string.IsNullOrWhiteSpace(SearchString))
     {
         return(true);
     }
     if (element.Publisher != null && element.Publisher.Contains(SearchString, StringComparison.OrdinalIgnoreCase))
     {
         return(true);
     }
     if (element.Title != null && element.Title.Contains(SearchString, StringComparison.OrdinalIgnoreCase))
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 5
0
 protected async Task <bool> Delete(Series series)
 {
     _messenger.DisplayErrorAlert("Deletion not currently available");
     return(false);
 }
Exemplo n.º 6
0
 protected async Task <bool> PutAside(Series series)
 {
     return(await MoveToShelf(series, Shelf.PutAside));
 }
Exemplo n.º 7
0
 protected async Task <bool> ReadNow(Series series)
 {
     return(await MoveToShelf(series, Shelf.Reading));
 }
Exemplo n.º 8
0
 protected async Task <bool> RemoveFromReadNext(Series series)
 {
     return(await MoveToShelf(series, Shelf.Unread));
 }
Exemplo n.º 9
0
 protected async Task <bool> AddToReadNext(Series series)
 {
     return(await MoveToShelf(series, Shelf.ToReadNext));
 }
Exemplo n.º 10
0
 protected async Task <bool> Archive(Series series)
 {
     return(await MoveToShelf(series, Shelf.Archived));
 }