public override async Task RefreshData() { ThreadListData = null; if (null == _fid) { return; } Util.Indicator.SetLoading(); try { var temp = await _dataService.GetThreadListAsync(_fid, CurrentPage); if (temp.CurrentPage == CurrentPage) { ThreadListData = temp; TotalPage = ThreadListData.TotalPage; NotifyOfPropertyChange(() => CanNextPage); NotifyOfPropertyChange(() => CanPrePage); Util.Indicator.SetBusy(false); } } catch (Exception e) { if (!HandleUserException(e)) { Util.Indicator.SetError(e); NotifyMessage = Util.ErrorMsg.GetExceptionMessage(e); } } }
public S1ThreadList GetData(string fid, int page) { var data = DZMyGroup.ThreadListFromJson(raw, fid); var list = new S1ThreadList { CurrentPage = data.CurrentPage != 0 ? data.CurrentPage : page, TotalPage = data.TotalPage }; if (data.ThreadList != null) FillList(data, list); return list; }
private static void FillList(IThreadList data, S1ThreadList list) { list.AddRange( data.ThreadList.Select(thread => new S1ListItem { Id = thread.Id, Title = S1Resource.HttpUtility.HtmlDecode(thread.Title), Subtle = S1Resource.HttpUtility.HtmlDecode(thread.Subtle), Author = S1Resource.HttpUtility.HtmlDecode(thread.Author), AuthorDate = thread.AuthorDate, LastPoster = S1Resource.HttpUtility.HtmlDecode(thread.LastPoster), LastPostDate = thread.LastPostDate })); }
public S1ThreadList GetData(string fid, int page) { var data = DZMyGroup.ThreadListFromJson(raw, fid); var list = new S1ThreadList { CurrentPage = data.CurrentPage != 0 ? data.CurrentPage : page, TotalPage = data.TotalPage }; if (data.ThreadList != null) { FillList(data, list); } return(list); }