Example #1
0
        /// <summary>
        /// This is an obsolete message type which was used to delete text annotations.
        /// RTDeleteAnnotation is currently used to delete different types of annotation sheets
        /// including text and image.
        /// </summary>
        /// <param name="rtdta"></param>
        private void ReceiveDeleteTextAnnotation(RTDeleteTextAnnotation rtdta)
        {
            int slideIndex;

            slideIndex = slideMap.GetMapping(rtdta.SlideIndex, rtdta.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(rtdta.Guid))
                {
                    so.TextAnnotations.Remove(rtdta.Guid);
                }
            }

            so.RefreshDynamicElements();
        }
Example #2
0
        private void FilterRTDeleteTextAnnotation(RTDeleteTextAnnotation rtdta)
        {
            Guid guid = rtdta.Guid;

            lock (subQueue) {
                //if annotation with this guid is found in low priority queue, remove it.
                //We assume there will never be more than one due to the way we enqueue annotations.
                for (int i = 0; i < subQueue.Count; i++)
                {
                    if ((((WorkItem)subQueue[i]).OpCode == PacketType.RTTextAnnotation) &&
                        (((WorkItem)subQueue[i]).Guid == guid))
                    {
                        subQueue.RemoveAt(i);
                        break;
                    }
                }
            }

            BufferChunk bc = new BufferChunk(Helpers.ObjectToByteArray(rtdta));

            enqueueMain(new WorkItem(bc, PacketType.RTDeleteTextAnnotation, rtdta.SlideIndex, rtdta.DeckGuid));
        }