private async Task RequestFavorites(bool isLoadingMore) { Favorites favData = null; if (isLoadingMore) { if (!FavoritesLastTime.HasValue) { return; } favData = await DataRequester.RequestFavorites(FavoritesLastTime.Value.ToString()); } else { ResetStories(); favData = await DataRequester.RequestLatestFavorites(); if (favData != null && favData.stories != null && favData.stories.Count > 0) { CurrentStoryId = favData.stories.First().Id.ToString(); } } if (favData == null) { return; } FavoritesLastTime = favData.last_time; StoryDataList.AddRange(favData.stories); }
private async Task RequestFavorites(bool isLoadingMore) { Favorites favData = null; if (isLoadingMore) { if (!FavoritesLastTime.HasValue) { return; } favData = await DataRequester.RequestFavorites(FavoritesLastTime.Value.ToString()); } else { ResetStorys(); UpdateTopStory(); favData = await DataRequester.RequestLatestFavorites(); if (favData != null) { CurrentStoryId = favData.stories.First().id.ToString(); FavoritesCount = favData.count; CategoryName = string.Format(StringUtil.GetString("FavCategoryName"), FavoritesCount); } } if (favData == null) { return; } FavoritesLastTime = favData.last_time; StoryDataList.AddRange(favData.stories); }