private void joinMeeting(string client_id, MeetingProposal proposal, List <Slot> desiredSlots) { Monitor.Enter(this.meetings); // client cannot join a meeting if it is closed or cancelled if (proposal.isClosed() || proposal.isCancelled()) { return; } proposal.addParticipant(client_id, desiredSlots); Console.WriteLine(client_id + " joined " + proposal.getTopic()); Monitor.Exit(this.meetings); }
// Private Methods private MeetingProposal mergeTwoMeetings(MeetingProposal proposal1, MeetingProposal proposal2) { Console.WriteLine("merging meetings"); foreach (string participant in proposal1.getParticipants().Keys) { if (!proposal2.getParticipants().ContainsKey(participant)) { proposal2.addParticipant(participant, proposal1.getParticipants()[participant]); } } return(proposal2); }