Exemplo n.º 1
0
        public void DispatchEvent(EventBase evt, IPanel panel)
        {
            IMouseEvent mouseEvent = evt as IMouseEvent;
            bool        flag       = DebuggerEventDispatchingStrategy.s_GlobalPanelDebug != null && mouseEvent != null;

            if (flag)
            {
                bool flag2 = DebuggerEventDispatchingStrategy.s_GlobalPanelDebug.InterceptMouseEvent(panel, mouseEvent);
                if (flag2)
                {
                    evt.StopPropagation();
                    evt.PreventDefault();
                    evt.stopDispatch = true;
                    return;
                }
            }
            BaseVisualElementPanel expr_4B    = panel as BaseVisualElementPanel;
            IPanelDebug            panelDebug = (expr_4B != null) ? expr_4B.panelDebug : null;
            bool flag3 = panelDebug != null;

            if (flag3)
            {
                bool flag4 = panelDebug.InterceptEvent(evt);
                if (flag4)
                {
                    evt.StopPropagation();
                    evt.PreventDefault();
                    evt.stopDispatch = true;
                }
            }
        }
Exemplo n.º 2
0
        protected override void ExecuteDefaultActionAtTarget(EventBase evt)
        {
            base.ExecuteDefaultActionAtTarget(evt);

            if (evt is KeyDownEvent kde)
            {
                if (!isDelayed || (!multiline && ((kde?.keyCode == KeyCode.KeypadEnter) || (kde?.keyCode == KeyCode.Return))))
                {
                    value = text;
                }

                if (multiline)
                {
                    // For multiline text fields, make sure tab doesn't trigger a focus change.
                    if (hasFocus && (kde?.keyCode == KeyCode.Tab || kde?.character == '\t'))
                    {
                        evt.StopPropagation();
                        evt.PreventDefault();
                    }
                    else if (((kde?.character == 3) && (kde?.shiftKey == true)) ||  // KeyCode.KeypadEnter
                             ((kde?.character == '\n') && (kde?.shiftKey == true))) // KeyCode.Return
                    {
                        Focus();
                        evt.StopPropagation();
                        evt.PreventDefault();
                    }
                }
                else if ((kde?.character == 3) ||    // KeyCode.KeypadEnter
                         (kde?.character == '\n'))   // KeyCode.Return
                {
                    if (hasFocus)
                    {
                        Focus();
                    }
                    else
                    {
                        textInput.textElement.Focus();
                    }
                    evt.StopPropagation();
                    evt.PreventDefault();
                }
            }
            else if (evt is ExecuteCommandEvent commandEvt)
            {
                string cmdName = commandEvt.commandName;
                if (!isDelayed && (cmdName == EventCommandNames.Paste || cmdName == EventCommandNames.Cut))
                {
                    value = text;
                }
            }
            // Prevent duplicated navigation events, since we're observing KeyDownEvents instead
            else if (evt.eventTypeId == NavigationSubmitEvent.TypeId() ||
                     evt.eventTypeId == NavigationCancelEvent.TypeId() ||
                     evt.eventTypeId == NavigationMoveEvent.TypeId())
            {
                evt.StopPropagation();
                evt.PreventDefault();
            }
        }
Exemplo n.º 3
0
            protected override void ExecuteDefaultActionAtTarget(EventBase evt)
            {
                base.ExecuteDefaultActionAtTarget(evt);

                if (evt == null)
                {
                    return;
                }

                if (evt.eventTypeId == KeyDownEvent.TypeId())
                {
                    KeyDownEvent kde = evt as KeyDownEvent;

                    if (!parentTextField.isDelayed || (!multiline && ((kde?.keyCode == KeyCode.KeypadEnter) || (kde?.keyCode == KeyCode.Return))))
                    {
                        parentTextField.value = text;
                    }

                    if (multiline)
                    {
                        if (kde?.character == '\t' && kde.modifiers == EventModifiers.None)
                        {
                            kde?.StopPropagation();
                            kde?.PreventDefault();
                        }
                        else if (((kde?.character == 3) && (kde?.shiftKey == true)) ||  // KeyCode.KeypadEnter
                                 ((kde?.character == '\n') && (kde?.shiftKey == true))) // KeyCode.Return
                        {
                            parent.Focus();
                            evt.StopPropagation();
                            evt.PreventDefault();
                        }
                    }
                    else if ((kde?.character == 3) ||    // KeyCode.KeypadEnter
                             (kde?.character == '\n'))   // KeyCode.Return
                    {
                        parent.Focus();
                        evt.StopPropagation();
                        evt.PreventDefault();
                    }
                }
                else if (evt.eventTypeId == ExecuteCommandEvent.TypeId())
                {
                    ExecuteCommandEvent commandEvt = evt as ExecuteCommandEvent;
                    string cmdName = commandEvt.commandName;
                    if (!parentTextField.isDelayed && (cmdName == EventCommandNames.Paste || cmdName == EventCommandNames.Cut))
                    {
                        parentTextField.value = text;
                    }
                }
                // Prevent duplicated navigation events, since we're observing KeyDownEvents instead
                else if (evt.eventTypeId == NavigationSubmitEvent.TypeId() ||
                         evt.eventTypeId == NavigationCancelEvent.TypeId() ||
                         evt.eventTypeId == NavigationMoveEvent.TypeId())
                {
                    evt.StopPropagation();
                    evt.PreventDefault();
                }
            }
Exemplo n.º 4
0
        public override void HandleEvent(EventBase evt)
        {
            base.HandleEvent(evt);

            if (evt == null)
            {
                return;
            }

            if (evt.propagationPhase != PropagationPhase.TrickleDown &&
                evt.propagationPhase != PropagationPhase.AtTarget &&
                evt.propagationPhase != PropagationPhase.BubbleUp)
            {
                return;
            }

            if (evt.imguiEvent == null)
            {
                return;
            }

            if (evt.isPropagationStopped)
            {
                return;
            }

            if (SendEventToIMGUI(evt))
            {
                evt.StopPropagation();
                evt.PreventDefault();
            }
        }
Exemplo n.º 5
0
        public override void HandleEvent(EventBase evt)
        {
            base.HandleEvent(evt);
            bool flag = evt == null;

            if (!flag)
            {
                bool flag2 = evt.propagationPhase != PropagationPhase.TrickleDown && evt.propagationPhase != PropagationPhase.AtTarget && evt.propagationPhase != PropagationPhase.BubbleUp;
                if (!flag2)
                {
                    bool flag3 = evt.imguiEvent == null;
                    if (!flag3)
                    {
                        bool isPropagationStopped = evt.isPropagationStopped;
                        if (!isPropagationStopped)
                        {
                            bool flag4 = this.SendEventToIMGUI(evt, true, true);
                            if (flag4)
                            {
                                evt.StopPropagation();
                                evt.PreventDefault();
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 6
0
        public override void HandleEvent(EventBase evt)
        {
            base.HandleEvent(evt);

            if (evt == null || evt.propagationPhase == PropagationPhase.DefaultAction)
            {
                return;
            }

            if (evt.imguiEvent == null)
            {
                return;
            }

            if (evt.isPropagationStopped)
            {
                return;
            }

            if (SendEventToIMGUI(evt))
            {
                evt.StopPropagation();
                evt.PreventDefault();
            }
        }
        protected internal override void PostDispatch(IPanel panel)
        {
            EventBase eventBase = ((IMouseEventInternal)this).sourcePointerEvent as EventBase;
            bool      flag      = eventBase != null;

            if (flag)
            {
                Debug.Assert(eventBase.processed);
                BaseVisualElementPanel expr_28 = panel as BaseVisualElementPanel;
                if (expr_28 != null)
                {
                    expr_28.CommitElementUnderPointers();
                }
                bool isPropagationStopped = base.isPropagationStopped;
                if (isPropagationStopped)
                {
                    eventBase.StopPropagation();
                }
                bool isImmediatePropagationStopped = base.isImmediatePropagationStopped;
                if (isImmediatePropagationStopped)
                {
                    eventBase.StopImmediatePropagation();
                }
                bool isDefaultPrevented = base.isDefaultPrevented;
                if (isDefaultPrevented)
                {
                    eventBase.PreventDefault();
                }
            }
            base.PostDispatch(panel);
        }
Exemplo n.º 8
0
        protected virtual void ProcessUpEvent(EventBase evt, Vector2 localPosition, int pointerId)
        {
            this.active = false;
            base.target.ReleasePointer(pointerId);
            bool flag = !(evt is IPointerEvent);

            if (flag)
            {
                base.target.panel.ProcessPointerCapture(PointerId.mousePointerId);
            }
            base.target.pseudoStates &= ~PseudoStates.Active;
            bool flag2 = this.IsRepeatable();

            if (flag2)
            {
                IVisualElementScheduledItem expr_62 = this.m_Repeater;
                if (expr_62 != null)
                {
                    expr_62.Pause();
                }
            }
            else
            {
                bool flag3 = base.target.ContainsPoint(localPosition);
                if (flag3)
                {
                    this.Invoke(evt);
                }
            }
            evt.StopPropagation();
        }
Exemplo n.º 9
0
 void Apply(KeyboardNavigationOperation op, EventBase sourceEvent)
 {
     if (Apply(op))
     {
         sourceEvent.StopPropagation();
         sourceEvent.PreventDefault();
     }
 }
Exemplo n.º 10
0
 static bool IsDone(EventBase evt)
 {
     if (evt.imguiEvent?.rawType == EventType.Used)
     {
         evt.StopPropagation();
     }
     return(evt.isPropagationStopped);
 }
        internal static void PropagateToIMGUIContainer(VisualElement root, EventBase evt)
        {
            //We don't support IMGUIContainers in player
            if (evt.imguiEvent == null || root.elementPanel.contextType == ContextType.Player)
            {
                return;
            }

            // Send the event to the first IMGUIContainer that can handle it.
            if (root.isIMGUIContainer)
            {
                var imContainer = root as IMGUIContainer;

                if (evt.Skip(imContainer))
                {
                    // IMGUIContainer have no children. We can return without iterating the children list.
                    return;
                }

                // Only permit switching the focus to another IMGUIContainer if the event target was not focusable.
                bool targetIsFocusable = (evt.target as Focusable)?.focusable ?? false;
                if (imContainer.SendEventToIMGUI(evt, !targetIsFocusable))
                {
                    evt.StopPropagation();
                    evt.PreventDefault();
                }

                if (evt.imguiEvent.rawType == EventType.Used)
                {
                    Debug.Assert(evt.isPropagationStopped);
                }
            }

            if (root.imguiContainerDescendantCount > 0)
            {
                using (ListPool <VisualElement> .Get(out var childrenToNotify))
                {
                    childrenToNotify.AddRange(root.hierarchy.children);

                    foreach (var child in childrenToNotify)
                    {
                        // if child is no longer in the hierarchy (removed when notified another child. See issue 1413477)
                        // , then ignore it.
                        if (child.hierarchy.parent != root)
                        {
                            continue;
                        }

                        PropagateToIMGUIContainer(child, evt);
                        if (evt.isPropagationStopped)
                        {
                            break;
                        }
                    }
                }
            }
        }
Exemplo n.º 12
0
 void DoDisplayMenu(EventBase evt)
 {
     if (target.elementPanel?.contextualMenuManager != null)
     {
         target.elementPanel.contextualMenuManager.DisplayMenu(evt, target);
         evt.StopPropagation();
         evt.PreventDefault();
     }
 }
Exemplo n.º 13
0
        protected override void ExecuteDefaultActionAtTarget(EventBase evt)
        {
            base.ExecuteDefaultActionAtTarget(evt);

            bool hasChanged = false;

            if (evt.eventTypeId == KeyDownEvent.TypeId())
            {
                KeyDownEvent kde = evt as KeyDownEvent;

                if ((kde?.character == 3) ||     // KeyCode.KeypadEnter
                    (kde?.character == '\n'))    // KeyCode.Return
                {
                    if (textEdition.hasFocus)
                    {
                        Focus();
                    }
                    else
                    {
                        textInputBase.textElement.Focus();
                    }
                    evt.StopPropagation();
                    evt.PreventDefault();
                }
                else if (!isReadOnly)
                {
                    hasChanged = true;
                }
            }
            else if (!isReadOnly && evt.eventTypeId == ExecuteCommandEvent.TypeId())
            {
                ExecuteCommandEvent commandEvt = evt as ExecuteCommandEvent;
                string cmdName = commandEvt.commandName;
                if (cmdName == EventCommandNames.Paste || cmdName == EventCommandNames.Cut)
                {
                    hasChanged = true;
                }
            }

            if (!isDelayed && hasChanged)
            {
                // Prevent text from changing when the value change
                // This allow expression (2+2) or string like 00123 to remain as typed in the TextField until enter is pressed
                m_UpdateTextFromValue = false;
                try
                {
                    textInputBase.UpdateValueFromText();
                }
                finally
                {
                    m_UpdateTextFromValue = true;
                }
            }
        }
        private static bool IsDone(EventBase evt)
        {
            Event expr_07 = evt.imguiEvent;
            bool  flag    = expr_07 != null && expr_07.rawType == EventType.Used;

            if (flag)
            {
                evt.StopPropagation();
            }
            return(evt.isPropagationStopped);
        }
Exemplo n.º 15
0
 internal void ProcessEvent(EventBase evt)
 {
     if (evt.imguiEvent != null && SendEventToIMGUI(evt) ||
         // Prevent navigation events since IMGUI already uses KeyDown events
         evt.eventTypeId == NavigationMoveEvent.TypeId() ||
         evt.eventTypeId == NavigationSubmitEvent.TypeId() ||
         evt.eventTypeId == NavigationCancelEvent.TypeId())
     {
         evt.StopPropagation();
         evt.PreventDefault();
     }
 }
Exemplo n.º 16
0
        private void ProcessDownEvent(EventBase evt)
        {
            // Make sure no other elements can capture the mouse!
            evt.StopPropagation();

            dragging = true;
            m_DragElement.RegisterCallback <PointerMoveEvent>(UpdateValueOnPointerMove);
            startValue = m_DrivenField.value;

            m_DrivenField.StartDragging();
            (m_DragElement.panel as BaseVisualElementPanel)?.uiElementsBridge?.SetWantsMouseJumping(1);
        }
 void OnMouseUpDownEvent(IMouseEvent evt)
 {
     if (CanStartManipulation(evt))
     {
         if (target.elementPanel != null && target.elementPanel.contextualMenuManager != null)
         {
             EventBase e = evt as EventBase;
             target.elementPanel.contextualMenuManager.DisplayMenu(e, target);
             e.StopPropagation();
             e.PreventDefault();
         }
     }
 }
Exemplo n.º 18
0
        private void ProcessEvent(EventBase evt)
        {
            if (evt.imguiEvent == null)
            {
                return;
            }

            if (SendEventToIMGUI(evt))
            {
                evt.StopPropagation();
                evt.PreventDefault();
            }
        }
Exemplo n.º 19
0
        protected override void ExecuteDefaultActionAtTarget(EventBase evt)
        {
            base.ExecuteDefaultActionAtTarget(evt);

            if (evt.imguiEvent == null)
            {
                return;
            }

            if (SendEventToIMGUI(evt))
            {
                evt.StopPropagation();
                evt.PreventDefault();
            }
        }
Exemplo n.º 20
0
        protected virtual void ProcessMoveEvent(EventBase evt, Vector2 localPosition)
        {
            this.lastMousePosition = localPosition;
            bool flag = base.target.ContainsPoint(localPosition);

            if (flag)
            {
                base.target.pseudoStates |= PseudoStates.Active;
            }
            else
            {
                base.target.pseudoStates &= ~PseudoStates.Active;
            }
            evt.StopPropagation();
        }
Exemplo n.º 21
0
        protected override void ExecuteDefaultActionAtTarget(EventBase evt)
        {
            base.ExecuteDefaultActionAtTarget(evt);
            bool flag = evt == null;

            if (!flag)
            {
                bool flag2 = base.eventInterpreter.IsActivationEvent(evt);
                if (flag2)
                {
                    this.clickable.SimulateSingleClick(evt, 100);
                    evt.StopPropagation();
                }
            }
        }
        private void OnMouseUpDownEvent(IMouseEvent evt)
        {
            bool flag = base.CanStartManipulation(evt);

            if (flag)
            {
                bool flag2 = base.target.elementPanel != null && base.target.elementPanel.contextualMenuManager != null;
                if (flag2)
                {
                    EventBase eventBase = evt as EventBase;
                    base.target.elementPanel.contextualMenuManager.DisplayMenu(eventBase, base.target);
                    eventBase.StopPropagation();
                    eventBase.PreventDefault();
                }
            }
        }
Exemplo n.º 23
0
        protected override void ExecuteDefaultActionAtTarget(EventBase evt)
        {
            base.ExecuteDefaultActionAtTarget(evt);

            if (evt == null)
            {
                return;
            }

            if (((evt as KeyDownEvent)?.keyCode == KeyCode.KeypadEnter) ||
                ((evt as KeyDownEvent)?.keyCode == KeyCode.Return))
            {
                OnClick();
                evt.StopPropagation();
            }
        }
        public void DispatchEvent(EventBase evt, IPanel panel)
        {
            bool flag = panel != null;

            if (flag)
            {
                Focusable leafFocusedElement = panel.focusController.GetLeafFocusedElement();
                bool      flag2 = leafFocusedElement != null;
                if (flag2)
                {
                    bool isIMGUIContainer = leafFocusedElement.isIMGUIContainer;
                    if (isIMGUIContainer)
                    {
                        IMGUIContainer iMGUIContainer = (IMGUIContainer)leafFocusedElement;
                        bool           flag3          = !evt.Skip(iMGUIContainer) && iMGUIContainer.SendEventToIMGUI(evt, true, true);
                        if (flag3)
                        {
                            evt.StopPropagation();
                            evt.PreventDefault();
                        }
                        bool flag4 = !evt.isPropagationStopped && evt.propagateToIMGUI;
                        if (flag4)
                        {
                            evt.skipElements.Add(iMGUIContainer);
                            EventDispatchUtilities.PropagateToIMGUIContainer(panel.visualTree, evt);
                        }
                    }
                    else
                    {
                        evt.target = panel.focusController.GetLeafFocusedElement();
                        EventDispatchUtilities.PropagateEvent(evt);
                        bool flag5 = !evt.isPropagationStopped && evt.propagateToIMGUI;
                        if (flag5)
                        {
                            EventDispatchUtilities.PropagateToIMGUIContainer(panel.visualTree, evt);
                        }
                    }
                }
                else
                {
                    EventDispatchUtilities.PropagateToIMGUIContainer(panel.visualTree, evt);
                }
            }
            evt.propagateToIMGUI = false;
            evt.stopDispatch     = true;
        }
Exemplo n.º 25
0
        internal static void PropagateToIMGUIContainer(VisualElement root, EventBase evt)
        {
            bool flag = evt.imguiEvent == null || root.elementPanel.contextType == ContextType.Player;

            if (!flag)
            {
                bool isIMGUIContainer = root.isIMGUIContainer;
                if (isIMGUIContainer)
                {
                    IMGUIContainer iMGUIContainer = root as IMGUIContainer;
                    bool           flag2          = evt.Skip(iMGUIContainer);
                    if (flag2)
                    {
                        return;
                    }
                    Focusable expr_54 = evt.target as Focusable;
                    bool      flag3   = expr_54 != null && expr_54.focusable;
                    bool      flag4   = iMGUIContainer.SendEventToIMGUI(evt, !flag3, true);
                    if (flag4)
                    {
                        evt.StopPropagation();
                        evt.PreventDefault();
                    }
                    bool flag5 = evt.imguiEvent.rawType == EventType.Used;
                    if (flag5)
                    {
                        Debug.Assert(evt.isPropagationStopped);
                    }
                }
                bool flag6 = root.imguiContainerDescendantCount > 0;
                if (flag6)
                {
                    int childCount = root.hierarchy.childCount;
                    for (int i = 0; i < childCount; i++)
                    {
                        EventDispatchUtilities.PropagateToIMGUIContainer(root.hierarchy[i], evt);
                        bool isPropagationStopped = evt.isPropagationStopped;
                        if (isPropagationStopped)
                        {
                            break;
                        }
                    }
                }
            }
        }
Exemplo n.º 26
0
        public override void ExecuteDefaultActionAtTarget(EventBase evt)
        {
            base.ExecuteDefaultActionAtTarget(evt);
            long num = EventBase <MouseDownEvent> .TypeId();

            bool flag = !base.textInputField.isReadOnly && evt.eventTypeId == num && base.editorEngine.keyboardOnScreen == null;

            if (flag)
            {
                base.textInputField.SyncTextEngine();
                base.textInputField.UpdateText(base.editorEngine.text);
                base.editorEngine.keyboardOnScreen = TouchScreenKeyboard.Open(base.textInputField.text, TouchScreenKeyboardType.Default, true, base.editorEngine.multiline, base.textInputField.isPasswordField);
                bool flag2 = base.editorEngine.keyboardOnScreen != null;
                if (flag2)
                {
                    this.PollTouchScreenKeyboard();
                }
                base.editorEngine.UpdateScrollOffset();
                evt.StopPropagation();
            }
        }
Exemplo n.º 27
0
        protected override void ExecuteDefaultActionAtTarget(EventBase evt)
        {
            base.ExecuteDefaultActionAtTarget(evt);

            if (evt == null)
            {
                return;
            }

            KeyDownEvent kde = (evt as KeyDownEvent);

            if (kde != null)
            {
                if ((kde.keyCode == KeyCode.Space) ||
                    (kde.keyCode == KeyCode.KeypadEnter) ||
                    (kde.keyCode == KeyCode.Return))
                {
                    ShowMenu();
                    evt.StopPropagation();
                }
            }
        }
Exemplo n.º 28
0
        protected override void ExecuteDefaultActionAtTarget(EventBase evt)
        {
            base.ExecuteDefaultActionAtTarget(evt);

            if (evt == null)
            {
                return;
            }

            var          showPopupMenu = false;
            KeyDownEvent kde           = (evt as KeyDownEvent);

            if (kde != null)
            {
                if ((kde.keyCode == KeyCode.Space) ||
                    (kde.keyCode == KeyCode.KeypadEnter) ||
                    (kde.keyCode == KeyCode.Return))
                {
                    showPopupMenu = true;
                }
            }
            else if ((evt as MouseDownEvent)?.button == (int)MouseButton.LeftMouse)
            {
                var mde = (MouseDownEvent)evt;
                if (visualInput.ContainsPoint(visualInput.WorldToLocal(mde.mousePosition)))
                {
                    showPopupMenu = true;
                }
            }

            if (showPopupMenu)
            {
                ShowMenu();
                evt.StopPropagation();
            }
        }
Exemplo n.º 29
0
            protected override void ExecuteDefaultActionAtTarget(EventBase evt)
            {
                base.ExecuteDefaultActionAtTarget(evt);
                bool flag = evt == null;

                if (!flag)
                {
                    bool flag2 = evt.eventTypeId == EventBase <KeyDownEvent> .TypeId();

                    if (flag2)
                    {
                        KeyDownEvent keyDownEvent = evt as KeyDownEvent;
                        bool         flag3        = !this.parentTextField.isDelayed || (!this.multiline && ((keyDownEvent != null && keyDownEvent.keyCode == KeyCode.KeypadEnter) || (keyDownEvent != null && keyDownEvent.keyCode == KeyCode.Return)));
                        if (flag3)
                        {
                            this.parentTextField.value = base.text;
                        }
                        bool multiline = this.multiline;
                        if (multiline)
                        {
                            char?c     = (keyDownEvent != null) ? new char?(keyDownEvent.character) : null;
                            int? num   = c.HasValue ? new int?((int)c.GetValueOrDefault()) : null;
                            int  num2  = 9;
                            bool flag4 = (num.GetValueOrDefault() == num2 & num.HasValue) && keyDownEvent.modifiers == EventModifiers.None;
                            if (flag4)
                            {
                                if (keyDownEvent != null)
                                {
                                    keyDownEvent.StopPropagation();
                                }
                                if (keyDownEvent != null)
                                {
                                    keyDownEvent.PreventDefault();
                                }
                            }
                            else
                            {
                                c    = ((keyDownEvent != null) ? new char?(keyDownEvent.character) : null);
                                num  = (c.HasValue ? new int?((int)c.GetValueOrDefault()) : null);
                                num2 = 3;
                                bool arg_1EE_0;
                                if (!(num.GetValueOrDefault() == num2 & num.HasValue) || keyDownEvent == null || !keyDownEvent.shiftKey)
                                {
                                    c         = ((keyDownEvent != null) ? new char?(keyDownEvent.character) : null);
                                    num       = (c.HasValue ? new int?((int)c.GetValueOrDefault()) : null);
                                    num2      = 10;
                                    arg_1EE_0 = ((num.GetValueOrDefault() == num2 & num.HasValue) && keyDownEvent != null && keyDownEvent.shiftKey);
                                }
                                else
                                {
                                    arg_1EE_0 = true;
                                }
                                bool flag5 = arg_1EE_0;
                                if (flag5)
                                {
                                    base.parent.Focus();
                                }
                            }
                        }
                        else
                        {
                            char?c    = (keyDownEvent != null) ? new char?(keyDownEvent.character) : null;
                            int? num  = c.HasValue ? new int?((int)c.GetValueOrDefault()) : null;
                            int  num2 = 3;
                            bool arg_2B8_0;
                            if (!(num.GetValueOrDefault() == num2 & num.HasValue))
                            {
                                c         = ((keyDownEvent != null) ? new char?(keyDownEvent.character) : null);
                                num       = (c.HasValue ? new int?((int)c.GetValueOrDefault()) : null);
                                num2      = 10;
                                arg_2B8_0 = (num.GetValueOrDefault() == num2 & num.HasValue);
                            }
                            else
                            {
                                arg_2B8_0 = true;
                            }
                            bool flag6 = arg_2B8_0;
                            if (flag6)
                            {
                                base.parent.Focus();
                            }
                        }
                    }
                    else
                    {
                        bool flag7 = evt.eventTypeId == EventBase <ExecuteCommandEvent> .TypeId();

                        if (flag7)
                        {
                            ExecuteCommandEvent executeCommandEvent = evt as ExecuteCommandEvent;
                            string commandName = executeCommandEvent.commandName;
                            bool   flag8       = !this.parentTextField.isDelayed && (commandName == "Paste" || commandName == "Cut");
                            if (flag8)
                            {
                                this.parentTextField.value = base.text;
                            }
                        }
                        else
                        {
                            NavigationDirection navigationDirection;
                            bool flag9 = base.eventInterpreter.IsActivationEvent(evt) || base.eventInterpreter.IsCancellationEvent(evt) || (base.eventInterpreter.IsNavigationEvent(evt, out navigationDirection) && navigationDirection != NavigationDirection.Previous && navigationDirection != NavigationDirection.Next);
                            if (flag9)
                            {
                                evt.StopPropagation();
                                evt.PreventDefault();
                            }
                        }
                    }
                }
            }