private void GetPostContent() { string postId = "post" + postNumber; HtmlNode t = doc.DocumentNode.SelectSingleNode("//table[@class='tborder voz-postbit' and @id='" + postId + "']"); Post p = new Post(); HAP.GetUserInfo(t, p); HAP.GetPostInfo(t, p); HAP.GetUserName(t, p); HAP.GetUserAva(t, p); HAP.GetQuoteAndReply(t, p, doc); Display(p); }
private void GetAllPost() { listPosts.Clear(); //get all post, each post is a table HtmlNodeCollection table = doc.DocumentNode.SelectSingleNode("//div[@id='posts']").SelectNodes(".//table[@class='tborder voz-postbit']"); foreach (HtmlNode t in table) { Post p = new Post(); HAP.GetUserInfo(t, p); HAP.GetPostInfo(t, p); HAP.GetUserName(t, p); HAP.GetUserAva(t, p); HAP.GetQuoteAndReply(t, p, doc); listPosts.Add(p); } //set binding listBoxPosts.ItemsSource = null; listBoxPosts.ItemsSource = listPosts; }