示例#1
0
        /// <summary>
        /// Handle RTUpdate -- one of the repeating messages emitted by Presenter 2.
        /// </summary>
        /// <param name="rtu"></param>
        private void WebViewerReceiveUpdate(ArchiveRTNav.RTUpdate rtu)
        {
            int internalSlideIndex = slideMap.GetMapping(rtu.SlideIndex, rtu.DeckGuid);

            /// Fetch slide images for any slide in a Presentation deck
            /// and any slide in a StudentSubmission deck.
            /// Note: it used to be that rtu.SlideIndex==0 in the SS case was
            /// a whiteboard slide.  This does not seem to be true anymore.  For CP3 we use explicit DeckTypeAssociation.
            if ((rtu.DeckType == (Int32)DeckTypeEnum.Presentation) ||
                ((rtu.DeckType == (Int32)DeckTypeEnum.StudentSubmission) && (rtu.DeckTypeAssociation != (Int32)DeckTypeEnum.Whiteboard)) ||
                ((rtu.DeckType == (Int32)DeckTypeEnum.QuickPoll) && (rtu.DeckTypeAssociation != (Int32)DeckTypeEnum.Whiteboard)))
            {
                Slide tmpSlide = slideDeck.GetSlide(internalSlideIndex);

                if ((tmpSlide == null) || (tmpSlide.Image == null))
                {
                    ThreadPool.QueueUserWorkItem(new WaitCallback(GetWebImageThread2), rtu);
                }
                else
                {
                    DisplaySlideIndex(internalSlideIndex);
                }
            }
            else             //No background image -- this is a whiteboard slide
            {
                DisplaySlideIndex(internalSlideIndex);
            }

            //if slide size is not up to date, fix that.
            //Console.WriteLine("WebviewerReceiveRTUpdate new slide size=" + rtu.SlideSize.ToString() +
            //	" current slide size=" + currentSlideSize.ToString());
            if (currentSlideSize != rtu.SlideSize)
            {
                currentSlideSize                   = rtu.SlideSize;
                this.screenConfiguration           = new ScreenConfiguration();
                this.screenConfiguration.SlideSize = rtu.SlideSize;
                AcceptScreenConfiguration();
            }

            //Update background color if necessary.
            if (currentBackgroundColor != rtu.BackgroundColor)
            {
                mySlideView.LayerPanel.BackColor = rtu.BackgroundColor;
                currentBackgroundColor           = rtu.BackgroundColor;
            }

            //Update scroll position
            workQueue.SetScrollPos(internalSlideIndex, (float)rtu.ScrollPosition, (float)rtu.ScrollExtent);
            if (workQueue.StartScrolling())
            {
                ThreadPool.QueueUserWorkItem(new WaitCallback(ScrollWorker));
            }
        }
示例#2
0
 /// <summary>
 /// The Presenter 2 version of ShowSlide
 /// </summary>
 /// <param name="rtu"></param>
 public void ShowSlide(ArchiveRTNav.RTUpdate rtu)
 {
     WebViewerReceiveUpdate(rtu);
 }