コード例 #1
0
        private async Task <ItemGroup <BookItem> > FetchMessageFromAPIAsync(
            string headString,
            string loc_id = "108288",
            uint start    = 0,
            uint count    = 8,
            int offset    = 0)
        {
            var gmodel = default(ItemGroup <BookItem>);

            try {
                var minised = (DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalMilliseconds;
                var result  = await BeansproutRequestHelper.FetchTypeCollectionList(headString, loc_id, start, count, minised, SubjectType.Music);

                if (result == null)
                {
                    ReportWhenGoesWrong("WebActionError");
                    return(gmodel);
                }
                JObject jo = JObject.Parse(result);
                gmodel = DataProcess.SetGroupResources(jo, gmodel);
                gmodel = SetSingletonResources(jo, gmodel);
            } catch { ReportHelper.ReportAttentionAsync(GetUIString("FetchJsonDataError")); }
            IncrementalLoadingBorder.SetVisibility(false);
            return(gmodel);
        }
コード例 #2
0
        private async Task <ItemGroup <MovieItem> > FetchMessageFromAPIAsync(
            string headString,
            string loc_id = "108288",
            uint start    = 0,
            uint count    = 8,
            int offset    = 0)
        {
            var gmodel = default(ItemGroup <MovieItem>);

            try {
                var    minised = (DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalMilliseconds;
                string result  = await BeansproutRequestHelper.FetchTypeCollectionList(headString, loc_id, start, count, minised, SubjectType.Movies);

                if (result != null)
                {
                    gmodel = JsonHelper.FromJson <ItemGroup <MovieItem> >(result);
                    if (gmodel.Items == null || gmodel.Items.Count < count)
                    {
                        isFinished = true;
                    }
                }
                else
                {
                    ReportWhenGoesWrong("WebActionError");
                    return(gmodel);
                }
            } catch { ReportHelper.ReportAttentionAsync(GetUIString("FetchJsonDataError")); }
            return(gmodel);
        }
コード例 #3
0
        private async Task <ItemGroup <MovieItem> > FetchMessageFromAPIAsync(
            string group,
            string loc_id = "108288",
            uint start    = 0,
            uint count    = 8,
            int offset    = 0)
        {
            var gmodel = default(ItemGroup <MovieItem>);

            try {
                var minised = (DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalMilliseconds;
                var result  = await BeansproutRequestHelper.FetchTypeCollectionList(group, loc_id, start, count, minised, SubjectType.Movies, RequestType.SubjectCollection);

                if (result != null)
                {
                    gmodel = JsonHelper.FromJson <ItemGroup <MovieItem> >(result);
                }
                else
                {
                    ReportWhenGoesWrong("WebActionError");
                    return(gmodel);
                }
            } catch { ReportHelper.ReportAttentionAsync(GetUIString("UnknownError")); }
            IncrementalLoadingBorder.SetVisibility(false);
            return(gmodel);
        }