private void HandleStylusUpHelper(object sender, int stylusId, int strokeId, int[] packets)
        {
            this.FlushPackets(stylusId, strokeId);

            Message message = new RealTimeInkSheetStylusUpMessage(this.m_Sheet, stylusId, strokeId, packets);

            message.Tags          = new MessageTags();
            message.Tags.SlideID  = this.m_SlideID;
            message.Tags.Priority = MessagePriority.RealTime;
            this.Sender.Send(message, MessagePriority.RealTime);
        }
        private void HandleStylusUpHelper(object sender, int stylusId, int strokeId, int[] packets)
        {
            this.FlushPackets(stylusId, strokeId);

            if (ViewerStateModel.NonStandardDpi)
            {
                RealTimeInkSheetModel.ScalePackets(packets, ViewerStateModel.DpiNormalizationSendMatrix);
            }

            Message message = new RealTimeInkSheetStylusUpMessage(this.m_Sheet, stylusId, strokeId, packets);

            message.Tags                = new MessageTags();
            message.Tags.SlideID        = m_SlideID;
            message.Tags.Priority       = MessagePriority.RealTime;
            message.Tags.BridgePriority = MessagePriority.RealTime;
            this.Sender.Send(message, MessagePriority.RealTime);
        }
Esempio n. 3
0
        /// <summary>
        /// On stylus-up we send a message to delete real-time ink.  Note we wouldn't need to do this if we could map real-time ink
        /// to completed strokes.
        /// </summary>
        /// <param name="rtissu"></param>
        /// <returns></returns>
        internal object AddRealTimeInkSheetStylusUp(UW.ClassroomPresenter.Network.Messages.Presentation.RealTimeInkSheetStylusUpMessage rtissu)
        {
            //Debug.WriteLine("***** Realtime Ink stylus Up StrokeID=" + rtissu.StrokeId.ToString() + "; stylusId=" + rtissu.StylusId.ToString());

            //Resolve sheetId to slideID, then use slideId to get the TOC entry.
            if (!this.sheetToSlideLookup.ContainsKey(rtissu.TargetId))
            {
                if (currentSlideId.Equals(Guid.Empty))
                {
                    warning += "Warning: Failed to find slide for a sheet which was the target of a stylus-up message.  May result in stray ink.  ";
                    return(null);
                }
                //Can we assume current slide?? Probably..
                sheetToSlideLookup.Add(rtissu.TargetId, currentSlideId);
            }

            Guid slideId = (Guid)this.sheetToSlideLookup[rtissu.TargetId];

            TableOfContents.TocEntry tocEntry = toc.LookupBySlideId(slideId);
            if (tocEntry == null)
            {
                warning += "Warning: Failed to find table of contents entry for sheet which was the target of a stylus-up message.  May result in stray ink.  ";
                return(null);
            }

            RTStrokeData rtsData;

            if (!this.realTimeStrokesPending.TryGetValue(rtissu.StrokeId, out rtsData))
            {
                //warning += "Warning: Failed to find stroke ID for a real-time ink stylus-up message.  May result in stray ink.  ";
                //Note that this seems to happen fairly frequently when using text annotations.  I suspect CP3 is sending stylus up
                //when the annotations are moved, etc.  This case has no consequences for stray ink, so we'll just remove the warning for now.
                Debug.WriteLine("Warning: Failed to find stroke ID for a real-time ink stylus-up message.  Could result in stray ink.  The warning could be bogus if text annotations were used.");
                return(null);
            }

            Debug.WriteLine("***** Removing Real-time stroke in response to stylus-up.  Stroke ID=" + rtsData.StrokeId.ToString());
            RTDeleteStroke rtds = rtsData.GetRTDeleteStroke();

            this.realTimeStrokesPending.Remove(rtissu.StrokeId);

            return(rtds);
        }
        private void HandleStylusUpHelper(object sender, int stylusId, int strokeId, int[] packets)
        {
            this.FlushPackets(stylusId, strokeId);

            if (ViewerStateModel.NonStandardDpi) {
                RealTimeInkSheetModel.ScalePackets(packets, ViewerStateModel.DpiNormalizationSendMatrix);
            }

            Message message = new RealTimeInkSheetStylusUpMessage(this.m_Sheet, stylusId, strokeId, packets);
            message.Tags = new MessageTags();
            message.Tags.SlideID = m_SlideID;
            message.Tags.Priority = MessagePriority.RealTime;
            message.Tags.BridgePriority = MessagePriority.RealTime;
            this.Sender.Send(message, MessagePriority.RealTime);
        }
        private void HandleStylusUpHelper(object sender, int stylusId, int strokeId, int[] packets)
        {
            this.FlushPackets(stylusId, strokeId);

            Message message = new RealTimeInkSheetStylusUpMessage(this.m_Sheet, stylusId, strokeId, packets);
            message.Tags = new MessageTags();
            message.Tags.SlideID = this.m_SlideID;
            message.Tags.Priority = MessagePriority.RealTime;
            this.Sender.Send(message, MessagePriority.RealTime);
        }