Ejemplo n.º 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();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Detach and attach occur in response to various events such as slide transitions.
        /// </summary>
        protected override void AttachData()
        {
            mySlideOverlay = null;
            base.AttachData();

            if (this.ViewData.Overlay != null)
            {
                mySlideOverlay = this.ViewData.Overlay;
                mySlideOverlay.DynamicElementChanged += new EventHandler(OnDynamicElementChanged);

                // Note in practice every overlay should have a TextAnnotations and a QuickPoll event
                // if they are empty and disabled.

                if (this.ViewData.Overlay.TextAnnotations != null)
                {
                    this.myAnnotations = this.ViewData.Overlay.TextAnnotations;
                }

                if (this.ViewData.Overlay.DynamicImages != null)
                {
                    this.myDynamicImages = this.ViewData.Overlay.DynamicImages;
                }

                if (this.ViewData.Overlay.QuickPoll != null)
                {
                    this.myQuickPoll = this.ViewData.Overlay.QuickPoll;
                }
            }

            if ((this.myAnnotations != null) ||
                (this.myQuickPoll != null))
            {
                this.Invalidate();
            }
        }
Ejemplo n.º 3
0
 public void ChangeSlide(Slide newSlide, SlideOverlay newOverlay)
 {
     if (newSlide != Slide || newOverlay != Overlay)
     {
         this.mySlide   = newSlide;
         this.myOverlay = newOverlay;
         OnChange();
     }
 }
Ejemplo n.º 4
0
 protected override void AttachData()
 {
     if (this.ViewData.Overlay != null)
     {
         myOverlay           = this.ViewData.Overlay;
         myOverlay.Scrolled += new EventHandler(this.HandleScroll);
     }
     base.AttachData();
 }
Ejemplo n.º 5
0
 protected override void DetachData()
 {
     if (myOverlay != null)
     {
         myOverlay.Scrolled -= new EventHandler(this.HandleScroll);
         myOverlay           = null;
     }
     base.DetachData();
 }
Ejemplo n.º 6
0
        private void Reset()
        {
            slideDeck.Reset();
            this.UpdateView();
            // Set all views to look at the zeroth slide.
            Slide        slide   = slideDeck.GetSlide(0) == null ? new Slide() : slideDeck.GetSlide(0);
            SlideOverlay overlay = slideDeck.GetOverlay(0) == null ? new SlideOverlay() : slideDeck.GetOverlay(0);

            this.mySlideView.Data.ChangeSlide(slide, overlay);
        }
Ejemplo n.º 7
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();
            }
        }
Ejemplo n.º 8
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();
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Delete all ink and text annotations on a slide -- Presenter 2
        /// </summary>
        /// <param name="rtel"></param>
        private void ReceiveClearScribble(ArchiveRTNav.RTEraseLayer rtel)
        {
            Int32        internalSlideIndex = slideMap.GetMapping(rtel.SlideIndex, rtel.DeckGuid);
            SlideOverlay overlay            = slideDeck.GetOverlay(internalSlideIndex);

            if (overlay != null)
            {
                if (overlay.Scribble != null)
                {
                    overlay.Scribble.Clear();
                }
                if ((overlay.TextAnnotations != null) && (overlay.TextAnnotations.Count > 0))
                {
                    lock (overlay.TextAnnotations) {
                        overlay.TextAnnotations.Clear();
                    }
                    overlay.RefreshDynamicElements();
                }
            }
        }
Ejemplo n.º 10
0
        public void ClearAnnotations(ArchiveRTNav.RTEraseAllLayers rteal)
        {
            ArrayList slides = slideMap.GetSlidesInDeck(rteal.DeckGuid);

            foreach (int internalSlideIndex in slides)
            {
                SlideOverlay overlay = slideDeck.GetOverlay(internalSlideIndex);
                if (overlay != null)
                {
                    if (overlay.Scribble != null)
                    {
                        overlay.Scribble.Clear();
                    }
                    if ((overlay.TextAnnotations != null) && (overlay.TextAnnotations.Count > 0))
                    {
                        lock (overlay.TextAnnotations) {
                            overlay.TextAnnotations.Clear();
                        }
                    }
                }
            }
        }
Ejemplo n.º 11
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();
        }
Ejemplo n.º 12
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();
        }
Ejemplo n.º 13
0
        protected override void DetachData()
        {
            if (myAnnotations != null)
            {
                myAnnotations = null;
            }
            if (myQuickPoll != null)
            {
                myQuickPoll = null;
            }
            if (myDynamicImages != null)
            {
                myDynamicImages = null;
            }

            if (mySlideOverlay != null)
            {
                mySlideOverlay.DynamicElementChanged -= new EventHandler(OnDynamicElementChanged);
                mySlideOverlay = null;
            }

            base.DetachData();
            this.Invalidate();
        }
Ejemplo n.º 14
0
 public SlideViewData()
 {
     mySlide   = null;
     myOverlay = null;
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Update the view of the slide to reflect the currentSlideIndex.
 /// </summary>
 public void NewSlide()
 {
     this.UpdateView();
     currentOverlay = slideDeck.GetOverlay(currentSlideIndex);
     currentSlide   = slideDeck.GetSlide(currentSlideIndex);
 }