private CommentItem CreateCommentItem(Comment comment)
        {
            User  user  = Enumerable.FirstOrDefault <User>(this.VM.Users, (Func <User, bool>)(u => u.uid == comment.from_id));
            User  user2 = Enumerable.FirstOrDefault <User>(this.VM.Users2, (Func <User, bool>)(u => u.uid == comment.reply_to_uid));
            Group group = Enumerable.FirstOrDefault <Group>(this.VM.Groups, (Func <Group, bool>)(g => g.id == -comment.from_id));

            if (user == null && comment.from_id == AppGlobalStateManager.Current.LoggedInUserId)
            {
                user = AppGlobalStateManager.Current.GlobalState.LoggedInUser;
            }
            if (user2 == null && comment.reply_to_uid == AppGlobalStateManager.Current.LoggedInUserId)
            {
                user2 = AppGlobalStateManager.Current.GlobalState.LoggedInUser;
            }
            Action <CommentItem> replyCallback = new Action <CommentItem>(this.ReplyToComment);
            LikeObjectType       likeObjType   = LikeObjectType.comment;

            if (this.VM.LikeObjectType == LikeObjectType.photo)
            {
                likeObjType = LikeObjectType.photo_comment;
            }
            if (this.VM.LikeObjectType == LikeObjectType.video)
            {
                likeObjType = LikeObjectType.video_comment;
            }
            if (this.VM.LikeObjectType == LikeObjectType.market)
            {
                likeObjType = LikeObjectType.market_comment;
            }
            return(CommentsItemsGeneratorHelper.CreateCommentItem(480.0, comment, likeObjType, this.VM.OwnerId, user, user2, group, new Action <CommentItem>(this.DeleteComment), replyCallback, new Action <CommentItem>(this.EditComment), null));
        }
Beispiel #2
0
 private CommentItem CreateCommentItem(User user, Comment c, VKClient.Common.Backend.DataObjects.Group group)
 {
     return(CommentsItemsGeneratorHelper.CreateCommentItem(480.0, c, LikeObjectType.topic_comment, -this._gid, user, (User)null, group, new Action <CommentItem>(this.deleteCommentCallback), new Action <CommentItem>(this.replyCommentCallback), new Action <CommentItem>(this.editCommentCallback), (Action <CommentItem>)null));
 }