Exemple #1
0
        /// <summary>
        /// Delete a text or image annotation.
        /// </summary>
        /// <param name="rtda"></param>
        private void ReceiveDeleteAnnotation(RTDeleteAnnotation rtda)
        {
            int slideIndex;

            slideIndex = slideMap.GetMapping(rtda.SlideIndex, rtda.DeckGuid);

            //Get the slide
            Slide        s  = SlideDeck.GetSlide(slideIndex);
            SlideOverlay so = SlideDeck.GetOverlay(slideIndex);

            //If the annotation is on the slide, delete it.
            lock (so.TextAnnotations) {
                if (so.TextAnnotations.ContainsKey(rtda.Guid))
                {
                    so.TextAnnotations.Remove(rtda.Guid);
                }
            }

            lock (so.DynamicImages) {
                if (so.DynamicImages.ContainsKey(rtda.Guid))
                {
                    so.DynamicImages.Remove(rtda.Guid);
                }
            }

            so.RefreshDynamicElements();
        }
Exemple #2
0
        private void ReceiveClearScribble(BufferChunk bc)
        {
            int slideIndex = UnpackShort(bc, 1);

            SlideOverlay overlay = slideDeck.GetOverlay(slideIndex);

            if (overlay != null && overlay.Scribble != null)
            {
                overlay.Scribble.Clear();
            }
        }
Exemple #3
0
        private void ReceiveQuickPoll(RTQuickPoll rtqp)
        {
            int slideIndex;

            //If we have already created the QuickPoll slide, get its index:
            slideIndex = slideMap.GetMapping(rtqp.SlideIndex, rtqp.DeckGuid);

            //Get the slide and overlay
            Slide        s  = SlideDeck.GetSlide(slideIndex);
            SlideOverlay so = SlideDeck.GetOverlay(slideIndex);

            so.QuickPoll.Update((int)rtqp.Style, rtqp.Results);
            so.QuickPoll.Enabled = true;

            so.RefreshDynamicElements();
        }
Exemple #4
0
            new Guid("{179222D6-BCC1-4570-8D8F-7E8834C1DD2A}");              //Presenter 2.0

        #endregion Static

        #region Constructor
        /// <summary>
        /// Construct
        /// </summary>
        /// <param name="view">The control where we display slides and ink</param>
        /// <param name="form">The top level form for the app</param>
        public SlideViewerGlue(LockedSlideView view, WebViewerForm form)
        {
            mySlideView = view;
            parent      = form;

            mySlideView.LockObject = form;
            mySlideView.Data       = new SlideViewData();

            currentBackgroundColor = mySlideView.LayerPanel.BackColor;

            this.webClient             = new System.Net.WebClient();
            this.webClient.BaseAddress = "";
            this.webClient.Credentials = null;

            //Scale factors to make ink appear at the right place on this display.
            Graphics g = form.CreateGraphics();

            XinkScaleFactor = 96.0 / g.DpiX;
            YinkScaleFactor = 96.0 / g.DpiY;
            g.Dispose();

            slideDeck         = new SlideDeck();     //Create deck with one blank slide
            currentSlideIndex = 0;
            currentSlideSize  = 1;

            //Put that slide and overlay into SlideViewData:
            mySlideView.Data.ChangeSlide(slideDeck.GetSlide(0), slideDeck.GetOverlay(0));

            //Prepare layers for the SlideView control
            mySlideView.ClearLayers();
            mySlideView.AddLayer(new ImageLayer());
            mySlideView.AddLayer(new DynamicElementsLayer());
            mySlideView.AddLayer(new InkLayer());

            mySlideView.Scrollable = false;              //The app can scroll, but the user can't

            //need this for scrolling:
            workQueue            = new WorkQueue();
            workQueue.LockObject = form;

            baseURL = null;
            extent  = null;

            //Map Presenter2 decks to a flat array.
            slideMap = new SlideMap();
        }
Exemple #5
0
        /// <summary>
        /// These are images that are added to slides "on-the-fly".
        /// </summary>
        /// <param name="rtia"></param>
        private void ReceiveImageAnnotation(RTImageAnnotation rtia)
        {
            //Get the internal slide index:
            int slideIndex = slideMap.GetMapping(rtia.SlideIndex, rtia.DeckGuid);

            //Get the slide and overlay
            Slide        s  = SlideDeck.GetSlide(slideIndex);
            SlideOverlay so = SlideDeck.GetOverlay(slideIndex);

            lock (so.DynamicImages) {
                //If the annotation is already on the slide, replace, otherwise add.
                if (so.DynamicImages.ContainsKey(rtia.Guid))
                {
                    so.DynamicImages[rtia.Guid] = new DynamicImage(rtia.Guid, rtia.Origin, rtia.Width, rtia.Height, rtia.Img);
                }
                else
                {
                    so.DynamicImages.Add(rtia.Guid, new DynamicImage(rtia.Guid, rtia.Origin, rtia.Width, rtia.Height, rtia.Img));
                }
            }
            so.RefreshDynamicElements();
        }
Exemple #6
0
        private void ReceiveTextAnnotation(RTTextAnnotation rtta)
        {
            int slideIndex;

            slideIndex = slideMap.GetMapping(rtta.SlideIndex, rtta.DeckGuid);

            //Get the slide and overlay
            Slide        s  = SlideDeck.GetSlide(slideIndex);
            SlideOverlay so = SlideDeck.GetOverlay(slideIndex);

            lock (so.TextAnnotations) {
                //If the annotation is already on the slide, replace, otherwise add.
                if (so.TextAnnotations.ContainsKey(rtta.Guid))
                {
                    so.TextAnnotations[rtta.Guid] = new TextAnnotation(rtta.Guid, rtta.Text, rtta.Color, rtta.Font, rtta.Origin, rtta.Width, rtta.Height);
                }
                else
                {
                    so.TextAnnotations.Add(rtta.Guid, new TextAnnotation(rtta.Guid, rtta.Text, rtta.Color, rtta.Font, rtta.Origin, rtta.Width, rtta.Height));
                }
            }
            so.RefreshDynamicElements();
        }