public PrivateCenter3(UISharedRTClient sharedClient, Main.OnDiscFrmClosing closing) { InitializeComponent(); _closing = closing; _sharedClient = sharedClient; theBadge.Hide(); PrivateCenterCtx.DropContext(); TimingCtx.Drop(); SetListeners(true); Title2 = string.Format("{0} on {1} - private dashboard", SessionInfo.Get().person.Name, SessionInfo.Get().discussion.Subject); lstTopics.ItemsSource = TopicsOfDiscussion; lstPoints.ItemsSource = OwnArgPoints; lstOtherUsers.ItemsSource = OtherUsers; lstBadgesOfOtherUser.ItemsSource = ArgPointsOfOtherUser; lblWelcome.Content = SessionInfo.Get().person.Name; _commentDismissalRecognizer = new CommentDismissalRecognizer(bigBadgeScroller, OnDismiss); theBadge.CommentDismissalRecognizer = _commentDismissalRecognizer; initializing = true; DiscussionSelectionChanged(); initializing = false; }
private void ForgetDBDiscussionState() { //forget cached state PrivateCenterCtx.DropContext(); TimingCtx.Drop(); ////////////////////// }
private void ArgPointChanged(int argPointId, int topicId, PointChangedType change, int personId) { if (change == PointChangedType.Modified) { //if a comment has been added by someone except us, update number of unread comments // onStructChanged(-1, -1, DeviceType.Wpf); //only show notification that there are new comments, not more. user will need to click Refresh var currTopic = lstTopics.SelectedItem as Topic; if (currTopic == null) { return; } if (topicId == currTopic.Id && personId != SessionInfo.Get().person.Id) { TimingCtx.Drop(); //if (DaoUtils.NumCommentsUnreadBy(TimingCtx.GetFresh(), argPointId).Total() > 0) thereAreNewComments.Visibility = Visibility.Visible; } } }
private void OnCommentRead(CommentsReadEvent ev) { theBadge.HandleCommentRead(ev); var topic = lstTopics.SelectedItem as Topic; if (topic != null && topic.Id == ev.TopicId) { bool changedPointOwnedByOtherUser = false; var changedPointExt = OwnArgPoints.FirstOrDefault(ap => ap.Ap.Id == ev.ArgPointId); if (changedPointExt == null) { changedPointExt = ArgPointsOfOtherUser.FirstOrDefault(ap => ap.Ap.Id == ev.ArgPointId); changedPointOwnedByOtherUser = true; } TimingCtx.Drop(); var ctx = TimingCtx.GetFresh(); //if the changed point is our own point if (changedPointExt != null) { changedPointExt.NumUnreadComments = DaoUtils.NumCommentsUnreadBy( ctx, changedPointExt.Ap.Id).Total(); if (changedPointOwnedByOtherUser) { UpdateOtherUsersDots(ctx, changedPointExt.Ap.Person.Id); } else { UpdateLocalUnreadCountsOwn(ctx); } } } }