Exemplo n.º 1
0
        public static CompositeInputControllerMartyr Activate(
            PointerInputType inputType)
        {
            var controllerMartyr = new CompositeInputControllerMartyr(previousInputType: ActiveInputType);

            switch (inputType)
            {
            case PointerInputType.Mouse:
                controllerMartyr.Add(martyr: PointerInput.Activate(pointer: Mouse.Instance));
                controllerMartyr.Add(martyr: MouseWheelInput.Activate(mouseWheel: Mouse.Instance));
                break;

            case PointerInputType.Pen:
                controllerMartyr.Add(martyr: PointerInput.Activate(pointer: Pen.Instance));
                controllerMartyr.Add(martyr: SinglePointGesture.Activate(pointer: Pen.Instance));
                break;

            case PointerInputType.SingleTouch:
                controllerMartyr.Add(martyr: PointerInput.Activate(pointer: SingleTouch.Instance));
                controllerMartyr.Add(martyr: SinglePointGesture.Activate(pointer: SingleTouch.Instance));
                break;

            case PointerInputType.MultiTouch:
                controllerMartyr.Add(martyr: PointerInput.Activate(pointer: MultiTouch.Instance));
                controllerMartyr.Add(martyr: SinglePointGesture.Activate(pointer: MultiTouch.Instance));
                controllerMartyr.Add(martyr: MultiPointGesture.Activate(pointer: MultiTouch.Instance));
                break;
            }

            ActiveInputType = inputType;
            return(controllerMartyr);
        }
Exemplo n.º 2
0
        public virtual void TapAndHold(double offsetX, double offsetY, uint duration)
        {
            var num1 = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "WaitForReady"));
            var num2 = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "MakeVisible"));

            if (ActionHandler.Invoke(sender: this, actionInfo: new ActionEventArgs(action: nameof(TapAndHold), offsetX, (object)offsetY, (object)duration)) != ActionResult.Unhandled)
            {
                return;
            }
            SinglePointGesture.Current.Move(point: ObjectPointToScreenPoint(objectPoint: new PointI(x: (int)Math.Round(a: offsetX), y: (int)Math.Round(a: offsetY))));
            SinglePointGesture.PressAndHold(holdDuration: duration);
        }
Exemplo n.º 3
0
        public virtual void Flick(PointI startPoint, PointI endPoint)
        {
            var num1 = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "WaitForReady"));
            var num2 = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "MakeVisible"));

            if (ActionHandler.Invoke(sender: this, actionInfo: new ActionEventArgs(action: nameof(Flick), startPoint, (object)endPoint)) == ActionResult.Unhandled)
            {
                var screenPoint1 = ObjectPointToScreenPoint(objectPoint: startPoint);
                var screenPoint2 = ObjectPointToScreenPoint(objectPoint: endPoint);
                SinglePointGesture.Current.Move(point: screenPoint1);
                var    defaultPressDuration = (int)InputManager.DefaultPressDuration;
                double flickAcceleration    = SinglePointGesture.DefaultFlickAcceleration;
                SinglePointGesture.Flick(endPoint: screenPoint2, holdDuration: (uint)defaultPressDuration, acceleration: (float)flickAcceleration);
            }

            var num3 = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "UIScrollComplete"));
        }