Ejemplo n.º 1
0
        private void UpdateOtherUsersDots(DiscCtx ctx, int singleUserId = -1)
        {
            if (_otherUsersDots.IsDuplicate())
            {
                return;
            }
            _otherUsersDots.RecordEvent();

            var topic = lstTopics.SelectedItem as Topic;

            if (topic == null)
            {
                return;
            }

            List <int> usersWithUnreadComments;

            if (singleUserId == -1)
            {
                usersWithUnreadComments = DaoUtils.SubsetOfPersonsWithDots(ctx,
                                                                           OtherUsers.Select(u0 => u0.Pers.Id).ToArray(),
                                                                           topic.Id);
            }
            else
            {
                usersWithUnreadComments = DaoUtils.SubsetOfPersonsWithDots(ctx,
                                                                           new [] { singleUserId },
                                                                           topic.Id);
            }

            foreach (var otherUser in OtherUsers)
            {
                if (singleUserId != -1 && otherUser.Pers.Id != singleUserId)
                {
                    continue;
                }

                otherUser.HasPointsWithUnreadComments =
                    usersWithUnreadComments != null &&
                    usersWithUnreadComments.Contains(otherUser.Pers.Id);
            }
        }
Ejemplo n.º 2
0
 public IEnumerable <string> GetSelectableOtherUserNames()
 {
     return(OtherUsers.Select(x => x.UserName));
 }