コード例 #1
0
        protected internal override void PostDispatch(IPanel panel)
        {
            bool flag = PointerType.IsDirectManipulationDevice(base.pointerType);

            if (flag)
            {
                panel.ReleasePointer(base.pointerId);
                BaseVisualElementPanel baseVisualElementPanel = panel as BaseVisualElementPanel;
                if (baseVisualElementPanel != null)
                {
                    baseVisualElementPanel.ClearCachedElementUnderPointer(this);
                }
            }
            bool flag2 = panel.ShouldSendCompatibilityMouseEvents(this);

            if (flag2)
            {
                using (MouseUpEvent pooled = MouseUpEvent.GetPooled(this))
                {
                    pooled.target = base.target;
                    pooled.target.SendEvent(pooled);
                }
            }
            panel.ActivateCompatibilityMouseEvents(base.pointerId);
            base.PostDispatch(panel);
        }
コード例 #2
0
        private static void UpdateElementUnderMouse(EventBase evt, BaseVisualElementPanel panel, out VisualElement elementUnderMouse)
        {
            IMouseEventInternal expr_07 = evt as IMouseEventInternal;

            elementUnderMouse = ((expr_07 == null || expr_07.recomputeTopElementUnderMouse) ? panel.RecomputeTopElementUnderPointer(((IMouseEvent)evt).mousePosition, evt) : panel.GetTopElementUnderPointer(PointerId.mousePointerId));
            bool flag = evt.eventTypeId == EventBase <MouseLeaveWindowEvent> .TypeId() && (evt as MouseLeaveWindowEvent).pressedButtons == 0;

            if (flag)
            {
                panel.ClearCachedElementUnderPointer(evt);
            }
        }
コード例 #3
0
        static void UpdateElementUnderMouse(EventBase evt, BaseVisualElementPanel panel, out VisualElement elementUnderMouse)
        {
            bool shouldRecomputeTopElementUnderMouse = (evt as IMouseEventInternal)?.recomputeTopElementUnderMouse ?? true;

            elementUnderMouse = shouldRecomputeTopElementUnderMouse
                ? panel.RecomputeTopElementUnderPointer(PointerId.mousePointerId, ((IMouseEvent)evt).mousePosition, evt)
                : panel.GetTopElementUnderPointer(PointerId.mousePointerId);

            // If mouse leaves the window, make sure element under mouse is null.
            // However, if pressed button != 0, we are getting a MouseLeaveWindowEvent as part of
            // of a drag and drop operation, at the very beginning of the drag. Since
            // we are not really exiting the window, we do not want to set the element
            // under mouse to null in this case.
            if (evt.eventTypeId == MouseLeaveWindowEvent.TypeId() &&
                (evt as MouseLeaveWindowEvent).pressedButtons == 0)
            {
                panel.ClearCachedElementUnderPointer(PointerId.mousePointerId, evt);
            }
        }
コード例 #4
0
        protected internal override void PostDispatch(IPanel panel)
        {
            if (PointerType.IsDirectManipulationDevice(pointerType))
            {
                panel.ReleasePointer(pointerId);
                BaseVisualElementPanel basePanel = panel as BaseVisualElementPanel;
                basePanel?.ClearCachedElementUnderPointer(this);
            }

            if (panel.ShouldSendCompatibilityMouseEvents(this))
            {
                using (var evt = MouseUpEvent.GetPooled(this))
                {
                    evt.target = target;
                    target.SendEvent(evt);
                }
            }

            base.PostDispatch(panel);
        }