示例#1
0
        ///////////////////////////////////////////////////////////////////// 
        /// <summary> 
        /// [TBS]
        /// </summary> 
        protected override void OnStylusUp(RawStylusInput rawStylusInput)
        {
            // Only allow inking if someone has queried our RootVisual.
            if (_mainContainerVisual != null) 
            {
                StrokeInfo si = FindStrokeInfo(rawStylusInput.Timestamp); 
 
                if (si != null &&
                    ((si.StylusId == rawStylusInput.StylusDeviceId) || 
                     (rawStylusInput.StylusDeviceId == 0 &&
                      (si.IsReset ||
                      (si.IsTimestampAfter(rawStylusInput.Timestamp) && IsStylusUp(si.StylusId))))))
                { 
                    si.SeenUp = true;
                    si.LastTime = rawStylusInput.Timestamp; 
                    rawStylusInput.NotifyWhenProcessed(si); 
                }
            } 
        }
示例#2
0
        /////////////////////////////////////////////////////////////////////
        /// <summary> 
        /// [TBS]
        /// </summary> 
        protected override void OnStylusDown(RawStylusInput rawStylusInput) 
        {
            // Only allow inking if someone has queried our RootVisual. 
            if (_mainContainerVisual != null)
            {
                StrokeInfo si;
 
                lock(__siLock)
                { 
                    si = FindStrokeInfo(rawStylusInput.Timestamp); 

                    // If we find we are already in the middle of stroke then bail out. 
                    // Can only ink with one stylus at a time.
                    if (si != null)
                    {
                        return; 
                    }
 
                    si = new StrokeInfo(DrawingAttributes, rawStylusInput.StylusDeviceId, rawStylusInput.Timestamp, GetCurrentHostVisual()); 
                    _strokeInfoList.Add(si);
                } 

                rawStylusInput.NotifyWhenProcessed(si);
                RenderPackets(rawStylusInput.GetStylusPoints(), si);
            } 
        }