Example #1
0
        public override void FetchCommentManList(LoadCommmentManCompleteHandler handler)
        {
            m_fetchCommentManListCompleted = handler;
            if (handler == null)
            {
                return;
            }
            if (App.DoubanAPI.IsAccessTokenOutOfDate())
            {
                MessageBox.Show("豆瓣授权已过期,请重新登陆", "温馨提示", MessageBoxButton.OK);
            }

            String doubanFollowID = PreferenceHelper.GetPreference("Douban_FollowerID");
            if (String.IsNullOrEmpty(doubanFollowID))
            {
                return;
            }
            String strCount = PreferenceHelper.GetPreference("Douban_RecentCount");
            if (string.IsNullOrEmpty(strCount))
            {
                strCount = "40";
            }

            App.DoubanAPI.GetUserTimeLine(doubanFollowID, int.Parse(strCount), (args) =>
            {
                if (args.errorCode == DoubanSdkErrCode.SUCCESS && args.statues != null)
                {
                    FetchCommentsInStatuesList(args.statues);
                }
                else
                {
                    handler(null);
                }
            });
        }
Example #2
0
 public override void FetchCommentManList(LoadCommmentManCompleteHandler callback)
 {
     if (callback == null)
     {
         return;
     }
     m_fetchCommentManListCompleted = callback;
     LoadSinaWeiboItems(LoadSinaWeiboCommentMen);
 }
Example #3
0
        public override void FetchCommentManList(LoadCommmentManCompleteHandler handler)
        {
            List<CommentMan> finalList = new List<CommentMan>();
            if (App.MainViewModel.SinaWeiboItems == null)
            {
                handler(finalList);
                return;
            }
            m_taskHelper = new TaskHelper(() =>
            {
                handler(finalList);                
            });   

            foreach (ItemViewModel item in App.MainViewModel.SinaWeiboItems)
            {
                m_taskHelper.PushTask();
                FetchSingleStatusComment(item.ID, finalList);
            }            
        }
Example #4
0
 public override void FetchCommentManList(LoadCommmentManCompleteHandler handler)
 {
     if (handler == null)
     {
         return;
     }
     LoadRenrenNews((List<RenrenNews> listNews) =>
     {
         List<CommentMan> resultList = new List<CommentMan>();
         if (listNews != null)
         {
             foreach (RenrenNews news in listNews)
             {
                 if (news.comments != null && news.comments.comment != null)
                 {
                     foreach (RenrenNews.Comments.Comment comment in news.comments.comment)
                     {
                         // 要去掉自己
                         if (comment.uid != PreferenceHelper.GetPreference("Renren_FollowerID")
                             && comment.uid != PreferenceHelper.GetPreference("Renren_ID"))
                         {
                             CommentMan man = new CommentMan
                             {
                                 name = comment.name,
                                 id = comment.uid
                             };
                             resultList.Add(man);
                         }
                     }
                 }
             }
             handler(resultList);
         }
         else
         {
             handler(resultList);
         }
     });
 }
Example #5
0
 public abstract void FetchCommentManList(LoadCommmentManCompleteHandler handler);