예제 #1
0
        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);
        }
예제 #2
0
파일: Thread.xaml.cs 프로젝트: rfcclub/Voz
        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;
        }