Esempio n. 1
0
        protected override void ParseImpl()
        {
            try
            {
                var root = HtmlPage.FindElements("table").Last()
                           .FindFirst("td").FindFirst("ul");
                GetPageCount(HtmlPage.FindFirst("body").FindElements("center").ElementAt(1));

                S1ListItem item = null;

                foreach (var e in root.Descendants("li"))
                {
                    item = S1ListItem.GetItem(e);
                    var replys = reply_pattern.Match(e.Element("span").InnerHtml);
                    if (replys.Success)
                    {
                        item.Subtle = replys.Value;
                    }
                    theData.Add(item);
                }
            }
            catch (System.Exception) { }
            finally
            {
                if (theData.Count == 0)
                {
                    S1Parser.User.ErrorParser.Parse(HtmlPage);
                    throw new InvalidDataException();
                }
            }
        }
Esempio n. 2
0
 public void DoNavigation(S1ListItem item)
 {
     if (item != null)
     {
         _navigationService
         .UriFor <ThreadListViewModel>()
         .WithParam(vm => vm.Fid, item.Id)
         .WithParam(vm => vm.Title, item.Title)
         .Navigate();
     }
 }
Esempio n. 3
0
        public void DoNavigation(S1ListItem item)
        {
            if (item == null)
            {
                return;
            }

            _navigationService.UriFor <PostViewModel>()
            .WithParam(vm => vm.Title, item.Title)
            .WithParam(vm => vm.Tid, item.Id)
            .Navigate();
        }
Esempio n. 4
0
        private S1ListItem BuildGroup(ForumItem g, ForumItem[] forumItem)
        {
            var group = new S1ListItem {Title = S1Resource.HttpUtility.HtmlDecode(g.Name)};
            var forums =
                from f in forumItem
                where f.Fup == g.Fid && !string.IsNullOrEmpty(f.Name)
                select new S1ListItem(S1Resource.HttpUtility.HtmlDecode(f.Name), f.Fid,
                    (from sub in forumItem
                        where sub.Fup == f.Fid && !string.IsNullOrEmpty(sub.Name)
                        select new S1ListItem
                        {
                            Title = S1Resource.HttpUtility.HtmlDecode(sub.Name),
                            Id = sub.Fid
                        }));

            group.AddRange(forums);
            return group;
        }
Esempio n. 5
0
        private S1ListItem BuildGroup(ForumItem g, ForumItem[] forumItem)
        {
            var group = new S1ListItem {
                Title = S1Resource.HttpUtility.HtmlDecode(g.Name)
            };
            var forums =
                from f in forumItem
                where f.Fup == g.Fid && !string.IsNullOrEmpty(f.Name)
                select new S1ListItem(S1Resource.HttpUtility.HtmlDecode(f.Name), f.Fid,
                                      (from sub in forumItem
                                       where sub.Fup == f.Fid && !string.IsNullOrEmpty(sub.Name)
                                       select new S1ListItem
            {
                Title = S1Resource.HttpUtility.HtmlDecode(sub.Name),
                Id = sub.Fid
            }));

            group.AddRange(forums);
            return(group);
        }
Esempio n. 6
0
        public void DoNavigation(S1ListItem item)
        {
            if (item == null) return;

            _navigationService.UriFor<PostViewModel>()
                .WithParam(vm => vm.Title, item.Title)
                .WithParam(vm => vm.Tid, item.Id)
                .Navigate();
        }