Exemplo n.º 1
0
        public async Task LoadUserRecentAsync()
        {
            if (!IsLoading && !IsUserRecentLoaded && IsSignedIn)
            {
                LoadingText = "Loading user recent...";
                IsLoading   = true;

                try
                {
                    RecentList = new ObservableCollection <Descriptor>();
                    var recentList = (await LightKindomHtmlClient.GetUserRecentViewedVolumesAsync()).ToList();
                    foreach (var item in recentList)
                    {
                        RecentList.Add(item);
                    }
                }
                catch (Exception)
                {
                    RecentList = null;
                    MessageBox.Show("Load User recent failed.");
                }

                IsLoading   = false;
                LoadingText = "";
            }
        }
Exemplo n.º 2
0
        public async Task SyncRecentListAsync()
        {
            var recent = await LightKindomHtmlClient.GetUserRecentViewedVolumesAsync();

            RecentList = recent.Select(item => new BookmarkInfo {
                Position = new NovelPositionIdentifier {
                    VolumeId = item.Id
                }, VolumeTitle = item.Title
            }).ToList();
        }
Exemplo n.º 3
0
        public async Task LoadOnlineAsync()
        {
            if (!IsLoading && !IsLoaded)
            {
                IsLoading = true;

                try
                {
                    var recentList = await LightKindomHtmlClient.GetUserRecentViewedVolumesAsync();

                    if (recentList != null)
                    {
                        this.Clear();
                        foreach (var item in recentList)
                        {
                            var hvm = new HistoryItemViewModel
                            {
                                Position = new NovelPositionIdentifier
                                {
                                    VolumeId = item.Id,
                                },
                                SeriesTitle = item.Title,
                            };
                            this.Add(hvm);
                        }
                    }
                }
                catch (Exception exception)
                {
                    throw exception;
                    //MessageBox.Show("Load User recent failed.");
                }
                NotifyPropertyChanged("IsEmpty");
                IsLoading = false;
            }
        }