Example #1
0
        public MessageWrapperFull(ProjectApiBase projectApiBase, Message message, ProjectWrapperFull project, IEnumerable <EmployeeWraperFull> subscribers, IEnumerable <FileWrapper> files, IEnumerable <CommentInfo> comments) :
            this(projectApiBase, message, project, subscribers)
        {
            Files = files.ToList();
            var creator = CoreContext.UserManager.GetUsers(message.CreateBy);

            Comments = new List <CommentInfo>(comments.Count() + 1)
            {
                new CommentInfo
                {
                    TimeStamp             = message.CreateOn,
                    TimeStampStr          = message.CreateOn.Ago(),
                    CommentBody           = HtmlUtility.GetFull(message.Description),
                    CommentID             = SecurityContext.CurrentAccount.ID.ToString() + "1",
                    UserID                = message.CreateBy,
                    UserFullName          = creator.DisplayUserName(),
                    UserProfileLink       = creator.GetUserProfilePageURL(),
                    Inactive              = false,
                    IsEditPermissions     = false,
                    IsResponsePermissions = false,
                    IsRead                = true,
                    UserAvatarPath        = creator.GetBigPhotoURL(),
                    UserPost              = creator.Title,
                    CommentList           = new List <CommentInfo>()
                }
            };
            Comments.AddRange(comments);
        }
 public MessageWrapperFull(Message message, ProjectWrapperFull project, IEnumerable <EmployeeWraperFull> subscribers) : base(message)
 {
     CanEditFiles = ProjectSecurity.CanEditFiles(message);
     CanReadFiles = ProjectSecurity.CanReadFiles(message.Project);
     Text         = HtmlUtility.GetFull(Text);
     Project      = project;
     Subscribers  = subscribers.ToList();
 }
 public TaskWrapperFull(Task task, Milestone milestone, ProjectWrapperFull project, IEnumerable <FileWrapper> files, IEnumerable <CommentInfo> comments, int commentsCount, bool isSubscribed, float timeSpend) : base(task, milestone)
 {
     Files            = files.ToList();
     CommentsCount    = commentsCount;
     IsSubscribed     = isSubscribed;
     Project          = project;
     CanEditFiles     = ProjectSecurity.CanEditFiles(task);
     CanCreateComment = ProjectSecurity.CanCreateComment(task);
     TimeSpend        = timeSpend;
     Comments         = comments.ToList();
 }