private void Conversation_HandleParticipantChange(object sender, ParticipantChangeEventArgs eventArgs) { if (eventArgs.AddedParticipants?.Count > 0) { foreach (var participant in eventArgs.AddedParticipants) { WriteToConsoleInColor(participant.Name + " has joined the meeting."); } } if (eventArgs.RemovedParticipants?.Count > 0) { foreach (var participant in eventArgs.RemovedParticipants) { WriteToConsoleInColor(participant.Name + " has left the meeting."); } } if (eventArgs.UpdatedParticipants?.Count > 0) { foreach (var participant in eventArgs.UpdatedParticipants) { WriteToConsoleInColor(participant.Name + " got updated"); } } }
private void OnParticipantChange(object sender, ParticipantChangeEventArgs args) { if (args.AddedParticipants != null) { args.AddedParticipants[0].HandleParticipantModalityChange += OnParticipantModalityChange; Logger.Instance.Information("Participant " + args.AddedParticipants[0].Name + " added"); } if (args.UpdatedParticipants != null) { Logger.Instance.Information("Participant " + args.UpdatedParticipants[0].Name + " updated"); } if (args.RemovedParticipants != null) { Logger.Instance.Information("Participant " + args.RemovedParticipants[0].Name + " removed"); args.RemovedParticipants[0].HandleParticipantModalityChange -= OnParticipantModalityChange; } }