private void ImportFromComment(Controllers.Comment comment) { Subreddit = comment.Subreddit; Author = comment.Author; Id = comment.Id; Name = comment.Fullname; Permalink = comment.Permalink; CreatedUTC = comment.Created; Edited = comment.Edited; Score = comment.Score; Ups = comment.UpVotes; Downs = comment.DownVotes; Removed = comment.Removed; Spam = comment.Spam; Body = comment.Body; BodyHTML = comment.BodyHTML; ParentId = comment.ParentFullname; CollapsedReason = comment.CollapsedReason; Collapsed = comment.Collapsed; IsSubmitter = comment.IsSubmitter; ScoreHidden = comment.ScoreHidden; Depth = comment.Depth; Replies = new MoreChildren(); if (comment.replies != null && comment.replies.Count > 0) { foreach (Controllers.Comment commentReply in comment.replies) { Replies.Comments.Add(commentReply.Listing); } } }
private void ImportFromComment(Controllers.Comment comment) { Subreddit = comment.Subreddit; Author = comment.Author; Id = comment.Id; Name = comment.Fullname; Permalink = comment.Permalink; Created = comment.Created; Edited = comment.Edited; Score = comment.Score; Ups = comment.UpVotes; Downs = comment.DownVotes; Removed = comment.Removed; Spam = comment.Spam; Body = comment.Body; BodyHTML = comment.BodyHTML; ParentId = comment.ParentFullname; CollapsedReason = comment.CollapsedReason; Collapsed = comment.Collapsed; IsSubmitter = comment.IsSubmitter; ScoreHidden = comment.ScoreHidden; Depth = comment.Depth; Replies = null; if (comment.Replies != null && comment.Replies.Count > 0) { Replies = new CommentContainer { Data = new CommentData { Children = new List <CommentChild>() } }; foreach (Controllers.Comment commentReply in comment.Replies) { Replies.Data.Children.Add(new CommentChild { Data = new Comment(commentReply) }); } } }
public Comment(Controllers.Comment comment) { ImportFromComment(comment); }