Ejemplo n.º 1
0
 public PointerInfoCache(SketchPointer sketchPointer, int hitLayer, PointerInfoCacheEvent cacheEvent)
 {
     SketchPointer = sketchPointer;
     CacheEvent    = cacheEvent;
     State         = sketchPointer.Pointer.LatestState;
     PointerPoint  = sketchPointer.Pointer.PointerPoint;
     HitLayer      = hitLayer;
 }
Ejemplo n.º 2
0
        private void InputManager_PointerEntered(object sender, IPointer e)
        {
            SketchPointer sketchPointer = new SketchPointer(this, e);

            lock (_SketchPointersReadyToEnterLock)
            {
                _SketchPointersReadyToEnter.Add(sketchPointer);
            }
            PointerInfoCache cache = new PointerInfoCache(sketchPointer, -1, PointerInfoCacheEvent.Entered);

            lock (_PointerInfoCachesLock)
            {
                _PointerInfoCaches.Enqueue(cache);
            }
            SketchEngine.RegisterForNextUpdate(this);
        }
Ejemplo n.º 3
0
        private void InputManager_PointerExited(object sender, IPointer e)
        {
            SketchPointer sketchPointer = null;

            lock (_SketchPointersListLock)
            {
                sketchPointer = SketchPointersList.Find((obj) =>
                {
                    if (obj.Pointer == e)
                    {
                        return(true);
                    }
                    return(false);
                });
            }
            if (sketchPointer == null)
            {
                lock (_SketchPointersReadyToEnterLock)
                {
                    sketchPointer = _SketchPointersReadyToEnter.Find((obj) =>
                    {
                        if (obj.Pointer == e)
                        {
                            return(true);
                        }
                        return(false);
                    });
                }
            }
            if (sketchPointer != null)
            {
                lock (_SketchPointersReadyToExitLock)
                {
                    _SketchPointersReadyToExit.Add(sketchPointer);
                }
                var cache = new PointerInfoCache(sketchPointer, sketchPointer.LatestPointerInfoCache.HitLayer, PointerInfoCacheEvent.Exited);
                lock (_PointerInfoCachesLock)
                {
                    _PointerInfoCaches.Enqueue(cache);
                }
            }
            SketchEngine.RegisterForNextUpdate(this);
        }
Ejemplo n.º 4
0
        private void InputManager_PointerPressed(object sender, IPointer e)
        {
            SketchPointer sketchPointer = null;

            lock (_SketchPointersListLock)
            {
                sketchPointer = SketchPointersList.Find((obj) =>
                {
                    if (obj.Pointer == e)
                    {
                        return(true);
                    }
                    return(false);
                });
            }
            if (sketchPointer == null)
            {
                lock (_SketchPointersReadyToEnterLock)
                {
                    sketchPointer = _SketchPointersReadyToEnter.Find((obj) =>
                    {
                        if (obj.Pointer == e)
                        {
                            return(true);
                        }
                        return(false);
                    });
                }
            }

            if (sketchPointer != null)
            {
                var cache = new PointerInfoCache(sketchPointer, 0, PointerInfoCacheEvent.Pressed);
                //throw new NotImplementedException("Do Remember implement Hit test and get layer");


                lock (_PointerInfoCachesLock)
                {
                    _PointerInfoCaches.Enqueue(cache);
                }
            }
            SketchEngine.RegisterForNextUpdate(this);
        }