Inheritance: ThingData, IVotable, ICreated
Ejemplo n.º 1
0
        public CommentViewModel(CommentsViewModel context, Comment comment, string linkId, int depth = 0)
        {
			_context = context;
            _isMinimized = false;
            _comment = comment;
            _linkId = linkId;
            Depth = depth;
            AuthorFlair = SnooStreamViewModel.RedditService.GetUsernameModifiers(_comment.Author, _linkId, _comment.Subreddit);
            AuthorFlairText = HttpUtility.HtmlDecode(_comment.AuthorFlairText);
			Body = HttpUtility.HtmlDecode(_comment.Body);
        }
Ejemplo n.º 2
0
        private CommentShell MakeCommentShell(Comment comment, int depth, CommentShell priorSibling)
        {
            var result = new CommentShell
            {
                Comment = new CommentViewModel(this, comment, comment.LinkId, depth),
				Id = comment.Id,
                Parent = comment.ParentId.StartsWith("t1_") ? comment.ParentId.Substring("t1_".Length) : null,
                PriorSibling = priorSibling != null ? priorSibling.Id : null,
                InsertionWaveIndex = _commentOriginStack.Count - 1,
                OriginType = _commentOriginStack.Last()
            };
            return result;
        }
Ejemplo n.º 3
0
 private void MergeComment(CommentShell priorSibling, Comment thingData)
 {
     priorSibling.OriginType = CommentOriginType.Edited;
     priorSibling.InsertionWaveIndex = _commentOriginStack.Count - 1;
     priorSibling.Comment.Thing = thingData;
 }