Beispiel #1
0
 private void HandleStudentNavChanged(object sender, PropertyEventArgs args)
 {
     if (this.m_Role is InstructorModel)
     {
         using (Synchronizer.Lock(this.m_Role.SyncRoot)) {
             this.m_StudentNavigationType = ((InstructorModel)this.m_Role).StudentNavigationType;
         }
     }
 }
Beispiel #2
0
        private QuickPollModel m_CurrentQuickPoll; // TODO: Can get this from the PresentationModel

        public InstructorModel(Guid id) : base(id)
        {
            this.m_CurrentPresentation           = null;
            this.m_CurrentDeckTraversal          = null;
            this.m_CurrentQuickPoll              = null;
            this.m_AcceptingStudentSubmissions   = true;
            this.m_AcceptingQuickPollSubmissions = false;
            this.m_ForcingStudentNavigationLock  = false;
            this.m_StudentNavigationType         = LinkedDeckTraversalModel.NavigationSelector.Full;
        }
Beispiel #3
0
 protected void m_NoNavigation_Click(object sender, EventArgs e)
 {
     this.m_StudentNavigationType           = LinkedDeckTraversalModel.NavigationSelector.None;
     this.m_FullNavigation.Checked          = false;
     this.m_VisitedSlidesNavigation.Checked = false;
     this.m_NoNavigation.Checked            = true;
     using (Synchronizer.Lock(this.m_Role.SyncRoot)) {
         ((InstructorModel)this.m_Role).StudentNavigationType        = this.m_StudentNavigationType;
         ((InstructorModel)this.m_Role).ForcingStudentNavigationLock = true;
     }
 }
 public InstructorModel(Guid id)
     : base(id)
 {
     this.m_CurrentPresentation = null;
     this.m_CurrentDeckTraversal = null;
     this.m_CurrentQuickPoll = null;
     this.m_AcceptingStudentSubmissions = true;
     this.m_AcceptingQuickPollSubmissions = false;
     this.m_ForcingStudentNavigationLock = false;
     this.m_StudentNavigationType = LinkedDeckTraversalModel.NavigationSelector.Full;
 }
Beispiel #5
0
 public InstructorMessage(InstructorModel role) : base(role)
 {
     using (Synchronizer.Lock(role.SyncRoot)) {
         this.AcceptingStudentSubmissions = role.AcceptingStudentSubmissions;
         // Need to add as an extension to maintain backward compatability
         this.Extension = new ExtensionWrapper(role.AcceptingQuickPollSubmissions, new Guid("{65A946F4-D1C5-426b-96DB-7AF4863CE296}"));
         ((ExtensionWrapper)this.Extension).AddExtension(new ExtensionWrapper(role.AcceptingQuickPollSubmissions, new Guid("{65A946F4-D1C5-426b-96DB-7AF4863CE296}")));
         ((ExtensionWrapper)this.Extension).AddExtension(new ExtensionWrapper(role.StudentNavigationType, new Guid("{4795707C-9F85-CA1F-FEBA-5E851CF9E1DE}")));
         this.AcceptingQuickPollSubmissions = role.AcceptingQuickPollSubmissions;
         this.ForcingStudentNavigationLock  = role.ForcingStudentNavigationLock;
         this.InstructorClockTicks          = UW.ClassroomPresenter.Misc.AccurateTiming.Now;
         this.StudentNavigationType         = role.StudentNavigationType;
     }
 }
Beispiel #6
0
        /// <summary>
        /// Instantiates a new <see cref="ViewerStateModel"/>.
        /// </summary>
        public ViewerStateModel()
        {
            this.m_PollStyle                          = QuickPollModel.QuickPollStyle.ABCD;
            this.m_Document                           = new PrintDocument();
            this.m_PrintableDeck                      = null;
            this.m_SlidesPerPage                      = 6;
            this.m_LoggingEnabled                     = true;
            this.m_LoggingPath                        = ".\\Logs";
            this.m_SecondMonitorEnabled               = true;
            this.m_SecondMonitorWindowsAPIsEnabled    = true;
            this.m_SecondMonitorCustomCommandsEnabled = false;
            this.m_SecondMonitorCustomCommandType     = "";
            this.m_SecondMonitorCloneCommand          = "";
            this.m_SecondMonitorExtendCommand         = "";
            this.m_NumberOfScreens                    = System.Windows.Forms.Screen.AllScreens.Length;
            this.m_SlidePreviewEnabled                = true;
            this.m_SlidePreviewVisible                = false;
            this.m_SlidePreviewWidth                  = 400;
            this.m_SlidePreviewHeight                 = 300;
            this.m_AutoScrollEnabled                  = true;
            this.m_FilmStripEnabled                   = true;
            this.m_PrimaryMonitorFullScreen           = false;
            this.m_FEC = 0;
            this.m_InterPacketDelay          = 0;
            this.m_BeaconInterval            = 5;
            this.m_FilmStripAlignment        = DockStyle.Right;
            this.m_SaveOnClose               = true;
            this.m_BroadcastDisabled         = false;
            this.m_UseLightColorSet          = false;
            this.m_ClassmateMode             = false;
            this.m_DefaultPenWidth           = 53;
            this.m_DefaultHLWidth            = 318;
            this.m_StudentSubmissionInterval = 5;
            this.m_Language   = "en";
            this.m_DeviceName = string.Empty;
            this.m_OutPutSize = "320x240";

            this.m_FilmStripWidth             = 1;
            this.m_SSFilmStripWidth           = 3;
            this.m_iRole                      = 0;//0-disconnected, 1-Viewer, 2-Presenter, 3-Public
            this.m_Advanced                   = false;
            this.m_ManualConnectionButtonName = "";
            this.m_TCPaddress                 = "";
            this.m_ShowIP                     = true;
            this.m_StudentNavigationType      = LinkedDeckTraversalModel.NavigationSelector.Full;

            this.m_Diagnostic     = new DiagnosticModel();
            this.m_WebPerformance = new WebPerformanceModel();
        }
Beispiel #7
0
        protected override void OnPaint(PaintEventArgs args)
        {
            if (this.m_Slide == null)
            {
                return;
            }
            RoleModel role = null;

            LinkedDeckTraversalModel.NavigationSelector studentNavigationType = LinkedDeckTraversalModel.NavigationSelector.Full;
            if (PresenterModel.TheInstance != null)
            {
                using (Synchronizer.Lock(PresenterModel.TheInstance.Participant.SyncRoot)) {
                    role = PresenterModel.TheInstance.Participant.Role;
                }

                using (Synchronizer.Lock(PresenterModel.TheInstance.ViewerState.SyncRoot)) {
                    studentNavigationType = PresenterModel.TheInstance.ViewerState.StudentNavigationType;
                }
            }
            // For student role, paint visited slides only.
            using (Synchronizer.Lock(this.m_Slide.SyncRoot)) {
                if (role != null && role is StudentModel && (!this.m_Slide.Visited) && studentNavigationType == LinkedDeckTraversalModel.NavigationSelector.Visited)
                {
                    return;
                }
            }

            // Slide content is painted first, on the bottom.
            this.m_ContentSlideRenderer.Paint(args);

            // Annotations are layered on top of the content.
            this.m_AnnotationsSlideRenderer.Paint(args);

            // Tell everybody else who's listening to paint (DynamicRenderers, etc.).
            base.OnPaint(args);
        }
Beispiel #8
0
        public void UpdateValues(object model)
        {
            // Make sure both objects exist and aren't the same
            if (model != null &&
                model is ViewerStateModel &&
                model != this)
            {
                ViewerStateModel m = (ViewerStateModel)model;

                // Lock both objects
                using (Synchronizer.Lock(this.SyncRoot)) {
                    using (Synchronizer.Lock(m.SyncRoot)) {
                        // Copy over the values
                        if (this.SlidesPerPage != m.SlidesPerPage)
                        {
                            this.SlidesPerPage = m.SlidesPerPage;
                        }
                        if (this.LoggingPath != m.LoggingPath)
                        {
                            this.LoggingPath = m.LoggingPath;
                        }
                        if (this.LoggingEnabled != m.LoggingEnabled)
                        {
                            this.LoggingEnabled = m.LoggingEnabled;
                        }
                        if (this.NumberOfScreens != m.NumberOfScreens)
                        {
                            this.NumberOfScreens = m.NumberOfScreens;
                        }
                        if (this.SecondMonitorEnabled != m.SecondMonitorEnabled)
                        {
                            this.SecondMonitorEnabled = m.SecondMonitorEnabled;
                        }
                        if (this.SecondMonitorWindowsAPIsEnabled != m.SecondMonitorWindowsAPIsEnabled)
                        {
                            this.SecondMonitorWindowsAPIsEnabled = m.SecondMonitorWindowsAPIsEnabled;
                        }
                        if (this.SecondMonitorCustomCommandsEnabled != m.SecondMonitorCustomCommandsEnabled)
                        {
                            this.SecondMonitorCustomCommandsEnabled = m.SecondMonitorCustomCommandsEnabled;
                        }
                        if (this.SecondMonitorCustomCommandType != m.SecondMonitorCustomCommandType)
                        {
                            this.SecondMonitorCustomCommandType = m.SecondMonitorCustomCommandType;
                        }
                        if (this.SecondMonitorCloneCommand != m.SecondMonitorCloneCommand)
                        {
                            this.SecondMonitorCloneCommand = m.SecondMonitorCloneCommand;
                        }
                        if (this.SecondMonitorExtendCommand != m.SecondMonitorExtendCommand)
                        {
                            this.SecondMonitorExtendCommand = m.SecondMonitorExtendCommand;
                        }
                        if (this.SlidePreviewEnabled != m.SlidePreviewEnabled)
                        {
                            this.SlidePreviewEnabled = m.SlidePreviewEnabled;
                        }
                        if (this.SlidePreviewWidth != m.SlidePreviewWidth)
                        {
                            this.SlidePreviewWidth = m.SlidePreviewWidth;
                        }
                        if (this.SlidePreviewHeight != m.SlidePreviewHeight)
                        {
                            this.SlidePreviewHeight = m.SlidePreviewHeight;
                        }
                        if (this.AutoScrollEnabled != m.AutoScrollEnabled)
                        {
                            this.AutoScrollEnabled = m.AutoScrollEnabled;
                        }
                        if (this.ForwardErrorCorrection != m.ForwardErrorCorrection)
                        {
                            this.ForwardErrorCorrection = m.ForwardErrorCorrection;
                        }
                        if (this.InterPacketDelay != m.InterPacketDelay)
                        {
                            this.InterPacketDelay = m.InterPacketDelay;
                        }
                        if (this.BeaconInterval != m.BeaconInterval)
                        {
                            this.BeaconInterval = m.BeaconInterval;
                        }
                        if (this.SaveOnClose != m.SaveOnClose)
                        {
                            this.SaveOnClose = m.SaveOnClose;
                        }
                        if (this.ShowIP != m.ShowIP)
                        {
                            this.ShowIP = m.ShowIP;
                        }
                        if (this.BroadcastDisabled != m.BroadcastDisabled)
                        {
                            this.BroadcastDisabled = m.BroadcastDisabled;
                        }
                        if (this.UseLightColorSet != m.UseLightColorSet)
                        {
                            this.UseLightColorSet = m.UseLightColorSet;
                        }
                        if (this.ClassmateMode != m.ClassmateMode)
                        {
                            this.ClassmateMode = m.ClassmateMode;
                        }
                        if (this.DefaultPenWidth != m.DefaultPenWidth)
                        {
                            this.DefaultPenWidth = m.DefaultPenWidth;
                        }
                        if (this.DefaultHLWidth != m.DefaultHLWidth)
                        {
                            this.DefaultHLWidth = m.DefaultHLWidth;
                        }
                        if (this.Language != m.Language)
                        {
                            this.Language = m.Language;
                        }
                        if (this.DeviceName != m.DeviceName)
                        {
                            this.DeviceName = m.DeviceName;
                        }
                        if (this.OutPutSize != m.OutPutSize)
                        {
                            this.OutPutSize = m.OutPutSize;
                        }
                        if (this.StudentSubmissionInterval != m.StudentSubmissionInterval)
                        {
                            this.StudentSubmissionInterval = m.StudentSubmissionInterval;
                        }
                        if (this.StudentNavigationType != m.StudentNavigationType)
                        {
                            this.StudentNavigationType = m.StudentNavigationType;
                        }
                    }
                }
            }
        }
Beispiel #9
0
 private void HandleStudentNavChanged(object sender, PropertyEventArgs args)
 {
     if (this.m_Role is InstructorModel) {
         using (Synchronizer.Lock(this.m_Role.SyncRoot)) {
             this.m_StudentNavigationType = ((InstructorModel)this.m_Role).StudentNavigationType;
         }
     }
 }
Beispiel #10
0
 protected void m_VisitedSlidesNavigation_Click(object sender, EventArgs e)
 {
     this.m_StudentNavigationType = LinkedDeckTraversalModel.NavigationSelector.Visited;
     this.m_FullNavigation.Checked = false;
     this.m_VisitedSlidesNavigation.Checked = true;
     this.m_NoNavigation.Checked = false;
     using (Synchronizer.Lock(this.m_Role.SyncRoot)) {
         ((InstructorModel)this.m_Role).StudentNavigationType = this.m_StudentNavigationType;
         ((InstructorModel)this.m_Role).ForcingStudentNavigationLock = false;
     }
 }
Beispiel #11
0
        protected override bool UpdateTarget(ReceiveContext context)
        {
            bool naviChanged = false;
            InstructorModel role = this.Target as InstructorModel;
            if(role == null)
                this.Target = role = new InstructorModel(((Guid) this.TargetId));

            using(Synchronizer.Lock(role.SyncRoot)) {
                role.AcceptingStudentSubmissions = this.AcceptingStudentSubmissions;
                // Deserialize the extension
                ExtensionWrapper extension = this.Extension as ExtensionWrapper;
                if (extension != null) {
                    try {
                        if (extension.ContainsKey(new Guid("{65A946F4-D1C5-426b-96DB-7AF4863CE296}")) || extension.ContainsKey(new Guid("{4795707C-9F85-CA1F-FEBA-5E851CF9E1DE}"))) {
                            bool acceptingQuickPollSubmissions = (bool)extension.GetExtension(new Guid("{65A946F4-D1C5-426b-96DB-7AF4863CE296}")).ExtensionObject;
                            this.AcceptingQuickPollSubmissions = acceptingQuickPollSubmissions;
                            LinkedDeckTraversalModel.NavigationSelector studentNavigationType = (LinkedDeckTraversalModel.NavigationSelector)extension.GetExtension(new Guid("{4795707C-9F85-CA1F-FEBA-5E851CF9E1DE}")).ExtensionObject;
                            this.StudentNavigationType = studentNavigationType;
                            using (Synchronizer.Lock(context.Model.ViewerState)) {
                                context.Model.ViewerState.StudentNavigationType = studentNavigationType;
                            }
                        }
                        else {
                            Trace.WriteLine("Unknown Extension id=" + extension.ExtensionType.ToString());
                        }
                    }
                    catch (Exception) {
                        if (extension.ExtensionType.Equals(new Guid("{65A946F4-D1C5-426b-96DB-7AF4863CE296}"))) {
                            bool acceptingQuickPollSubmissions = (bool)extension.ExtensionObject;
                                this.AcceptingQuickPollSubmissions = acceptingQuickPollSubmissions;
                         }
                         else {
                             Trace.WriteLine("Unknown Extension id=" + extension.ExtensionType.ToString());
                         }
                    }
                }
                else {
                    Trace.WriteLine("Unknown Extension id=" + this.Extension.GetType().ToString());
                }
                role.AcceptingQuickPollSubmissions = this.AcceptingQuickPollSubmissions;
                role.ForcingStudentNavigationLock = this.ForcingStudentNavigationLock;
                if (this.StudentNavigationType == LinkedDeckTraversalModel.NavigationSelector.None)
                    role.ForcingStudentNavigationLock = true;
                if (role.StudentNavigationType != this.StudentNavigationType)
                    naviChanged = true;
                role.StudentNavigationType = this.StudentNavigationType;
            }

            //if StudentNavigationType changed, refresh FilmStrip region
            if (naviChanged) {
                using (Synchronizer.Lock(context.Model.ViewerState.SyncRoot)) {
                    bool oldShowFilmStrip = context.Model.ViewerState.FilmStripEnabled;
                    context.Model.ViewerState.FilmStripEnabled = false;
                    context.Model.ViewerState.FilmStripEnabled = oldShowFilmStrip;
                }
            }

            // Update the clock skew from our current value.
            using( Synchronizer.Lock( context.Model.ViewerState.Diagnostic.SyncRoot ) ) {
                context.Model.ViewerState.Diagnostic.AddSkewEntry( this.InstructorClockTicks );
            }

            base.UpdateTarget(context);

            return true;
        }
Beispiel #12
0
 public InstructorMessage(InstructorModel role)
     : base(role)
 {
     using(Synchronizer.Lock(role.SyncRoot)) {
         this.AcceptingStudentSubmissions = role.AcceptingStudentSubmissions;
         // Need to add as an extension to maintain backward compatability
         this.Extension = new ExtensionWrapper( role.AcceptingQuickPollSubmissions, new Guid("{65A946F4-D1C5-426b-96DB-7AF4863CE296}") );
         ((ExtensionWrapper)this.Extension).AddExtension(new ExtensionWrapper(role.AcceptingQuickPollSubmissions, new Guid("{65A946F4-D1C5-426b-96DB-7AF4863CE296}")));
         ((ExtensionWrapper)this.Extension).AddExtension(new ExtensionWrapper(role.StudentNavigationType, new Guid("{4795707C-9F85-CA1F-FEBA-5E851CF9E1DE}")));
         this.AcceptingQuickPollSubmissions = role.AcceptingQuickPollSubmissions;
         this.ForcingStudentNavigationLock = role.ForcingStudentNavigationLock;
         this.InstructorClockTicks = UW.ClassroomPresenter.Misc.AccurateTiming.Now;
         this.StudentNavigationType = role.StudentNavigationType;
     }
 }
        /// <summary>
        /// Instantiates a new <see cref="ViewerStateModel"/>.
        /// </summary>
        public ViewerStateModel()
        {
            this.m_PollStyle = QuickPollModel.QuickPollStyle.ABCD;
            this.m_Document = new PrintDocument();
            this.m_PrintableDeck = null;
            this.m_SlidesPerPage = 6;
            this.m_LoggingEnabled = true;
            this.m_LoggingPath = ".\\Logs";
            this.m_SecondMonitorEnabled = true;
            this.m_SecondMonitorWindowsAPIsEnabled = true;
            this.m_SecondMonitorCustomCommandsEnabled = false;
            this.m_SecondMonitorCustomCommandType = "";
            this.m_SecondMonitorCloneCommand = "";
            this.m_SecondMonitorExtendCommand = "";
            this.m_NumberOfScreens = System.Windows.Forms.Screen.AllScreens.Length;
            this.m_SlidePreviewEnabled = true;
            this.m_SlidePreviewVisible = false;
            this.m_SlidePreviewWidth = 400;
            this.m_SlidePreviewHeight = 300;
            this.m_AutoScrollEnabled = true;
            this.m_FilmStripEnabled = true;
            this.m_PrimaryMonitorFullScreen = false;
            this.m_FEC = 0;
            this.m_InterPacketDelay = 0;
            this.m_BeaconInterval = 5;
            this.m_FilmStripAlignment = DockStyle.Right;
            this.m_SaveOnClose = true;
            this.m_BroadcastDisabled = false;
            this.m_UseLightColorSet = false;
            this.m_ClassmateMode = false;
            this.m_DefaultPenWidth = 53;
            this.m_DefaultHLWidth = 318;
            this.m_StudentSubmissionInterval = 5;
            this.m_Language = "en";
            this.m_DeviceName = string.Empty;
            this.m_OutPutSize = "320x240";

            this.m_FilmStripWidth = 1;
            this.m_SSFilmStripWidth = 3;
            this.m_iRole = 0;//0-disconnected, 1-Viewer, 2-Presenter, 3-Public
            this.m_Advanced = false;
            this.m_ManualConnectionButtonName = "";
            this.m_TCPaddress = "";
            this.m_ShowIP = true;
            this.m_StudentNavigationType = LinkedDeckTraversalModel.NavigationSelector.Full;

            this.m_Diagnostic = new DiagnosticModel();
            this.m_WebPerformance = new WebPerformanceModel();
        }
Beispiel #14
0
        protected override bool UpdateTarget(ReceiveContext context)
        {
            bool            naviChanged = false;
            InstructorModel role        = this.Target as InstructorModel;

            if (role == null)
            {
                this.Target = role = new InstructorModel(((Guid)this.TargetId));
            }

            using (Synchronizer.Lock(role.SyncRoot)) {
                role.AcceptingStudentSubmissions = this.AcceptingStudentSubmissions;
                // Deserialize the extension
                ExtensionWrapper extension = this.Extension as ExtensionWrapper;
                if (extension != null)
                {
                    try {
                        if (extension.ContainsKey(new Guid("{65A946F4-D1C5-426b-96DB-7AF4863CE296}")) || extension.ContainsKey(new Guid("{4795707C-9F85-CA1F-FEBA-5E851CF9E1DE}")))
                        {
                            bool acceptingQuickPollSubmissions = (bool)extension.GetExtension(new Guid("{65A946F4-D1C5-426b-96DB-7AF4863CE296}")).ExtensionObject;
                            this.AcceptingQuickPollSubmissions = acceptingQuickPollSubmissions;
                            LinkedDeckTraversalModel.NavigationSelector studentNavigationType = (LinkedDeckTraversalModel.NavigationSelector)extension.GetExtension(new Guid("{4795707C-9F85-CA1F-FEBA-5E851CF9E1DE}")).ExtensionObject;
                            this.StudentNavigationType = studentNavigationType;
                            using (Synchronizer.Lock(context.Model.ViewerState)) {
                                context.Model.ViewerState.StudentNavigationType = studentNavigationType;
                            }
                        }
                        else
                        {
                            Trace.WriteLine("Unknown Extension id=" + extension.ExtensionType.ToString());
                        }
                    }
                    catch (Exception) {
                        if (extension.ExtensionType.Equals(new Guid("{65A946F4-D1C5-426b-96DB-7AF4863CE296}")))
                        {
                            bool acceptingQuickPollSubmissions = (bool)extension.ExtensionObject;
                            this.AcceptingQuickPollSubmissions = acceptingQuickPollSubmissions;
                        }
                        else
                        {
                            Trace.WriteLine("Unknown Extension id=" + extension.ExtensionType.ToString());
                        }
                    }
                }
                else
                {
                    Trace.WriteLine("Unknown Extension id=" + this.Extension.GetType().ToString());
                }
                role.AcceptingQuickPollSubmissions = this.AcceptingQuickPollSubmissions;
                role.ForcingStudentNavigationLock  = this.ForcingStudentNavigationLock;
                if (this.StudentNavigationType == LinkedDeckTraversalModel.NavigationSelector.None)
                {
                    role.ForcingStudentNavigationLock = true;
                }
                if (role.StudentNavigationType != this.StudentNavigationType)
                {
                    naviChanged = true;
                }
                role.StudentNavigationType = this.StudentNavigationType;
            }

            //if StudentNavigationType changed, refresh FilmStrip region
            if (naviChanged)
            {
                using (Synchronizer.Lock(context.Model.ViewerState.SyncRoot)) {
                    bool oldShowFilmStrip = context.Model.ViewerState.FilmStripEnabled;
                    context.Model.ViewerState.FilmStripEnabled = false;
                    context.Model.ViewerState.FilmStripEnabled = oldShowFilmStrip;
                }
            }

            // Update the clock skew from our current value.
            using (Synchronizer.Lock(context.Model.ViewerState.Diagnostic.SyncRoot)) {
                context.Model.ViewerState.Diagnostic.AddSkewEntry(this.InstructorClockTicks);
            }

            base.UpdateTarget(context);

            return(true);
        }