private static void SetBestTargetForEvent(EventBase evt, BaseVisualElementPanel panel)
        {
            VisualElement visualElement;

            MouseEventDispatchingStrategy.UpdateElementUnderMouse(evt, panel, out visualElement);
            bool flag = evt.target != null;

            if (flag)
            {
                evt.propagateToIMGUI = false;
            }
            else
            {
                bool flag2 = visualElement != null;
                if (flag2)
                {
                    evt.propagateToIMGUI = false;
                    evt.target           = visualElement;
                }
                else
                {
                    evt.target = ((panel != null) ? panel.visualTree : null);
                }
            }
        }
        private static bool SendEventToIMGUIContainer(EventBase evt, BaseVisualElementPanel panel)
        {
            bool flag = evt.imguiEvent == null;
            bool result;

            if (flag)
            {
                result = false;
            }
            else
            {
                IMGUIContainer rootIMGUIContainer = panel.rootIMGUIContainer;
                bool           flag2 = rootIMGUIContainer == null;
                if (flag2)
                {
                    result = false;
                }
                else
                {
                    bool flag3 = evt.propagateToIMGUI || evt.eventTypeId == EventBase <MouseEnterWindowEvent> .TypeId() || evt.eventTypeId == EventBase <MouseLeaveWindowEvent> .TypeId();

                    if (flag3)
                    {
                        evt.skipElements.Add(evt.target);
                        EventDispatchUtilities.PropagateToIMGUIContainer(panel.visualTree, evt);
                    }
                    result = MouseEventDispatchingStrategy.IsDone(evt);
                }
            }
            return(result);
        }
        public void DispatchEvent(EventBase evt, IPanel iPanel)
        {
            bool flag = iPanel != null;

            if (flag)
            {
                Assert.IsTrue(iPanel is BaseVisualElementPanel);
                BaseVisualElementPanel panel = (BaseVisualElementPanel)iPanel;
                MouseEventDispatchingStrategy.SetBestTargetForEvent(evt, panel);
                MouseEventDispatchingStrategy.SendEventToTarget(evt, panel);
            }
            evt.stopDispatch = true;
        }
        private static bool SendEventToRegularTarget(EventBase evt, BaseVisualElementPanel panel)
        {
            bool flag = evt.target == null;
            bool result;

            if (flag)
            {
                result = false;
            }
            else
            {
                EventDispatchUtilities.PropagateEvent(evt);
                result = MouseEventDispatchingStrategy.IsDone(evt);
            }
            return(result);
        }
 private static bool SendEventToTarget(EventBase evt, BaseVisualElementPanel panel)
 {
     return(MouseEventDispatchingStrategy.SendEventToRegularTarget(evt, panel) || MouseEventDispatchingStrategy.SendEventToIMGUIContainer(evt, panel));
 }