void client_GroupDetailsChange(object sender, GroupDetailsEventArgs e) { foreach (var group in e.ChangedGroups) { var convo = FindConversation(group.Name); if (convo == null) { continue; } var oldMembers = (from participant in convo.Participants select participant.User).ToList(); foreach (var member in group.Members) { if (!oldMembers.Contains(member)) { conversationEventsMap[convo.Name].RaiseUserAdded(new UserEventArgs(member)); } } foreach (var member in oldMembers) { if (!group.Members.Contains(member)) { conversationEventsMap[convo.Name].RaiseUserRemoved(new UserEventArgs(member)); } } } }
private void OnGroupDetailsChange(object sender, GroupDetailsEventArgs e) { App.Current.Dispatcher.Invoke(() => { UpdateContacts(e.AddedGroups, e.ChangedGroups); }); }
void client_GroupDetailsChange(object sender, GroupDetailsEventArgs e) { foreach (var group in e.ChangedGroups) { var convo = FindConversation(group.Name); if (convo == null) continue; var oldMembers = (from participant in convo.Participants select participant.User).ToList(); foreach (var member in group.Members) { if (!oldMembers.Contains(member)) conversationEventsMap[convo.Name].RaiseUserAdded(new UserEventArgs(member)); } foreach (var member in oldMembers) { if (!group.Members.Contains(member)) conversationEventsMap[convo.Name].RaiseUserRemoved(new UserEventArgs(member)); } } }