private void ProcessMenuCommand(string command)
 {
     using (ExecuteCommandEvent pooled = CommandEventBase <ExecuteCommandEvent> .GetPooled(command))
     {
         pooled.target = this;
         this.SendEvent(pooled);
     }
 }
Ejemplo n.º 2
0
        internal static EventBase CreateEvent(Event systemEvent, EventType eventType)
        {
            EventBase pooled;

            switch (eventType)
            {
            case EventType.MouseDown:
            {
                bool flag = PointerDeviceState.HasAdditionalPressedButtons(PointerId.mousePointerId, systemEvent.button);
                if (flag)
                {
                    pooled = PointerEventBase <PointerMoveEvent> .GetPooled(systemEvent);

                    return(pooled);
                }
                pooled = PointerEventBase <PointerDownEvent> .GetPooled(systemEvent);

                return(pooled);
            }

            case EventType.MouseUp:
            {
                bool flag2 = PointerDeviceState.HasAdditionalPressedButtons(PointerId.mousePointerId, systemEvent.button);
                if (flag2)
                {
                    pooled = PointerEventBase <PointerMoveEvent> .GetPooled(systemEvent);

                    return(pooled);
                }
                pooled = PointerEventBase <PointerUpEvent> .GetPooled(systemEvent);

                return(pooled);
            }

            case EventType.MouseMove:
                pooled = PointerEventBase <PointerMoveEvent> .GetPooled(systemEvent);

                return(pooled);

            case EventType.MouseDrag:
                pooled = PointerEventBase <PointerMoveEvent> .GetPooled(systemEvent);

                return(pooled);

            case EventType.KeyDown:
                pooled = KeyboardEventBase <KeyDownEvent> .GetPooled(systemEvent);

                return(pooled);

            case EventType.KeyUp:
                pooled = KeyboardEventBase <KeyUpEvent> .GetPooled(systemEvent);

                return(pooled);

            case EventType.ScrollWheel:
                pooled = WheelEvent.GetPooled(systemEvent);
                return(pooled);

            case EventType.DragUpdated:
                pooled = DragUpdatedEvent.GetPooled(systemEvent);
                return(pooled);

            case EventType.DragPerform:
                pooled = MouseEventBase <DragPerformEvent> .GetPooled(systemEvent);

                return(pooled);

            case EventType.ValidateCommand:
                pooled = CommandEventBase <ValidateCommandEvent> .GetPooled(systemEvent);

                return(pooled);

            case EventType.ExecuteCommand:
                pooled = CommandEventBase <ExecuteCommandEvent> .GetPooled(systemEvent);

                return(pooled);

            case EventType.DragExited:
                pooled = DragExitedEvent.GetPooled(systemEvent);
                return(pooled);

            case EventType.ContextClick:
                pooled = MouseEventBase <ContextClickEvent> .GetPooled(systemEvent);

                return(pooled);

            case EventType.MouseEnterWindow:
                pooled = MouseEventBase <MouseEnterWindowEvent> .GetPooled(systemEvent);

                return(pooled);

            case EventType.MouseLeaveWindow:
                pooled = MouseLeaveWindowEvent.GetPooled(systemEvent);
                return(pooled);
            }
            pooled = IMGUIEvent.GetPooled(systemEvent);
            return(pooled);
        }