/// <summary> /// Constructor /// </summary> /// <param name="sender">The sending queue to post messages to</param> /// <param name="role">The InstructorModel to create this class for</param> public InstructorNetworkService(SendingQueue sender, InstructorModel role) : base(sender, role) { this.m_Instructor = role; // Create the submission status service submission_status_service_ = new SubmissionStatusNetworkService(this.Sender, role); // Handle basic changes this.m_GenericChangeDispatcher = new EventQueue.PropertyEventDispatcher(this.Sender, new PropertyEventHandler(this.HandleGenericChange)); this.m_Instructor.Changed["ForcingStudentNavigationLock"].Add(this.m_GenericChangeDispatcher.Dispatcher); this.m_Instructor.Changed["AcceptingStudentSubmissions"].Add(this.m_GenericChangeDispatcher.Dispatcher); this.m_Instructor.Changed["AcceptingQuickPollSubmissions"].Add(this.m_GenericChangeDispatcher.Dispatcher); this.m_Instructor.Changed["StudentNavigationType"].Add(this.m_GenericChangeDispatcher.Dispatcher); // Handle changes to the current presentation this.m_CurrentPresentationChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.Sender, new PropertyEventHandler(this.HandleCurrentPresentationChanged)); this.m_Instructor.Changed["CurrentPresentation"].Add(this.m_CurrentPresentationChangedDispatcher.Dispatcher); this.m_CurrentPresentationChangedDispatcher.Dispatcher(this, null); // Handle changes to the current deck traversal this.m_CurrentDeckTraversalChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.Sender, new PropertyEventHandler(this.HandleCurrentDeckTraversalChanged)); this.m_Instructor.Changed["CurrentDeckTraversal"].Add(this.m_CurrentDeckTraversalChangedDispatcher.Dispatcher); this.m_CurrentDeckTraversalChangedDispatcher.Dispatcher(this, null); #if WEBSERVER // Create the web service equivalent to this service this.m_InstructorWebService = new Web.Network.InstructorWebService(this.Sender, role); using (Synchronizer.Lock(PresenterModel.TheInstance.SyncRoot)) { using (Synchronizer.Lock(PresenterModel.TheInstance.ViewerState.SyncRoot)) { this.m_WebPerformanceWebService = new Web.Network.WebPerformanceWebService(this.Sender, PresenterModel.TheInstance.ViewerState.WebPerformance); } } #endif }
/// <summary> /// Constructor /// </summary> /// <param name="sender">The sending queue to post messages to</param> /// <param name="role">The InstructorModel to create this class for</param> public InstructorNetworkService(SendingQueue sender, InstructorModel role) : base(sender, role) { this.m_Instructor = role; // Create the submission status service submission_status_service_ = new SubmissionStatusNetworkService(this.Sender, role); // Handle basic changes this.m_GenericChangeDispatcher = new EventQueue.PropertyEventDispatcher(this.Sender, new PropertyEventHandler(this.HandleGenericChange)); this.m_Instructor.Changed["ForcingStudentNavigationLock"].Add(this.m_GenericChangeDispatcher.Dispatcher); this.m_Instructor.Changed["AcceptingStudentSubmissions"].Add(this.m_GenericChangeDispatcher.Dispatcher); this.m_Instructor.Changed["AcceptingQuickPollSubmissions"].Add(this.m_GenericChangeDispatcher.Dispatcher); this.m_Instructor.Changed["StudentNavigationType"].Add(this.m_GenericChangeDispatcher.Dispatcher); // Handle changes to the current presentation this.m_CurrentPresentationChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.Sender, new PropertyEventHandler(this.HandleCurrentPresentationChanged)); this.m_Instructor.Changed["CurrentPresentation"].Add(this.m_CurrentPresentationChangedDispatcher.Dispatcher); this.m_CurrentPresentationChangedDispatcher.Dispatcher(this, null); // Handle changes to the current deck traversal this.m_CurrentDeckTraversalChangedDispatcher = new EventQueue.PropertyEventDispatcher(this.Sender, new PropertyEventHandler(this.HandleCurrentDeckTraversalChanged)); this.m_Instructor.Changed["CurrentDeckTraversal"].Add(this.m_CurrentDeckTraversalChangedDispatcher.Dispatcher); this.m_CurrentDeckTraversalChangedDispatcher.Dispatcher(this, null); #if WEBSERVER // Create the web service equivalent to this service this.m_InstructorWebService = new Web.Network.InstructorWebService( this.Sender, role ); using (Synchronizer.Lock(PresenterModel.TheInstance.SyncRoot)) { using (Synchronizer.Lock(PresenterModel.TheInstance.ViewerState.SyncRoot)) { this.m_WebPerformanceWebService = new Web.Network.WebPerformanceWebService(this.Sender, PresenterModel.TheInstance.ViewerState.WebPerformance); } } #endif }