void OnUserRemoved(object sender, UserEventArgs e) { participants.Remove(GetParticipant(e.User)); UserRemoved.SafeInvoke(this, e); if (participants.Count == 0) { Ended.SafeInvoke(this, new EventArgs()); events.UserAdded -= OnUserAdded; events.UserChanged -= OnUserChanged; events.UserRemoved -= OnUserRemoved; events.UserTyping -= OnUserTyping; events.ChatReceived -= OnChatReceived; } }