Beispiel #1
0
        public override async Task GetLatest()
        {
            if (this.comments_list == null)
                await FirstTimeDownload();
            else
            {
                await Task.Delay(400);
                VKResponseList<Comment> _comments = await provider.Call<VKResponseList<Comment>>("wall.getComments", new Dictionary<string, string>() {
            { "owner_id", owner_id.ToString() },
            { "post_id", post_id.ToString() },
            { "offset", (this.comments_list.Count).ToString()}});
                if (_comments == null || _comments.response.Count == 0) return;
                System.Diagnostics.Debug.WriteLine("Have Comments");

                this.comments_list.AddRange(_comments.response);
                await AddProfiles(_comments);

                Core.UpdateArgs args = new Core.UpdateArgs()
                {
                    first = 0,
                    last = _comments.response.Count - 1,
                    updateType = Core.UpdateType.FirstTime
                };
                RiseUpdate(args);
            }
        }
Beispiel #2
0
        public override async Task FirstTimeDownload()
        {
            VKResponseList<Comment> _comments = await provider.Call<VKResponseList<Comment>>("wall.getComments", new Dictionary<string, string>() { {"owner_id", owner_id.ToString() },
            {"post_id", post_id.ToString() },});
            if (_comments != null && _comments.response.Count != 0)
            {
                System.Diagnostics.Debug.WriteLine("Have Comments");

                this.comments_list = _comments.response;
                this.profiles = new HashSet<Profiles.IVKProfile>();
                await AddProfiles(_comments);
                Core.UpdateArgs args = new Core.UpdateArgs()
                {
                    first = 0,
                    last = _comments.response.Count - 1,
                    updateType = Core.UpdateType.FirstTime
                };
                RiseUpdate(args);
            }
        }