DvachBrowser.ViewModels.PostListViewModel.UpdatePosts C# (CSharp) Method

UpdatePosts() public method

public UpdatePosts ( ) : void
return void
        public void UpdatePosts()
        {
            if (this._updateTask != null)
            {
                this._updateTask.Cancel();
            }

            // load posts from the network
            string postsUrl = this._urlBuilder.BuildPostsUrl(this.BoardName, this.ThreadNumber);
            this._updateTask = new HttpGetJsonTask<PostListModel>(postsUrl, this.OnPostsLoadedAfterUpdate);
            this._updateTask.OnError = this.ShowErrorAfterUpdate;
            this._updateTask.OnProgressChanged = val => this.ProgressAfterUpdate = val;

            this.IsLoadingAfterUpdate = true;
            this._updateTask.Execute();
        }