protected override void OnItemActivate(EventArgs e) { base.OnItemActivate(e); ParticipantModel association = this.SelectedItems.Count > 0 ? this.SelectedItems[0].Tag as ParticipantModel : null; if (association != null) { using (Synchronizer.Lock(this.m_Model.Participant)) { if (this.m_Model.Participant.Role is InstructorModel || this.m_Model.Participant.Role == null) { this.m_Model.Participant.Role = new StudentModel(Guid.NewGuid()); } } using (Synchronizer.Lock(this.m_Model.Network.SyncRoot)) { this.m_Model.Network.Association = association; } } else { StartJoinButton.StartEmptyPresentation(this.m_Model); } }
protected override void OnClick(EventArgs e) { base.OnClick(e); if (this.m_Association != null) { // Set the role accordingly using (Synchronizer.Lock(this.m_Model.Participant)) { if (this.m_Model.Participant.Role is InstructorModel || this.m_Model.Participant.Role == null) { this.m_Model.Participant.Role = new StudentModel(Guid.NewGuid()); } } // Set the network association using (Synchronizer.Lock(this.m_Model.Network.SyncRoot)) { this.m_Model.Network.Association = this.Association; } } else { // Instead Start an Empty Presentation StartJoinButton.StartEmptyPresentation(this.m_Model); } }