internal void AddPreviousMessages(IEnumerable <ChatMessageViewModel> messages) { bool hasUpdates = false; _messages.IsNotifying = false; foreach (var chatMessage in messages.Reverse()) { chatMessage.HasBeenSeen = true; var firstMessageGroup = _messages.FirstOrDefault() as ChatMessageGroupViewModel; if (firstMessageGroup == null || !firstMessageGroup.TryAddPreviousMessage(chatMessage)) { var groupMessage = new ChatMessageGroupViewModel(chatMessage); _messages.Insert(0, groupMessage); hasUpdates = true; } } _messages.IsNotifying = true; if (hasUpdates) { _messages.Refresh(); } IsRequestingPreviousMessages = false; }
internal void UserLeft(UserViewModel user) { RoomUserViewModel leftUser = _users.FirstOrDefault(x => x.User.Equals(user)); if (leftUser != null) { _users.Remove(leftUser); } // TODO: Implement notification to the room of left user. }
private void UpdateTraceWatchers() { var activeTrace = TraceWatchers.FirstOrDefault(t => t.IsChecked); foreach (var tw in TraceWatchers) { tw.CheckEnabled(ActiveDocument, activeTrace); } }