コード例 #1
0
        public async void init(Request r)
        {
            RedditSession reddit = new RedditSession();

            List <Post> posts = await reddit.getPosts(r);

            foreach (var post in posts)
            {
                var np = new PostViewModel(post);
                Posts.Add(np);
            }
        }
コード例 #2
0
        public async void init(String permalink, String commentId)
        {
            RedditSession        reddit   = new RedditSession();
            List <RedditComment> comments = await reddit.getComments(permalink, commentId);

            foreach (var comment in comments)
            {
                var np = new CommentViewModel(comment);
                np.replies = new List <CommentViewModel>();
                foreach (var reply in comment.replies)
                {
                    np.replies.Add(NestReplies(reply));
                }
                _Comments.Add(np);
            }
        }