Esempio n. 1
0
        // Window moves through pan gestures.
        private void OnWinPanGestureDetected(object source, PanGestureDetector.DetectedEventArgs e)
        {
            if (currentGesture <= CurrentGesture.PanGesture /*&& panGesture.NumberOfTouches == 1*/)
            {
                PanGesture panGesture = e.PanGesture;

                if (panGesture.State == Gesture.StateType.Started)
                {
                    currentGesture = CurrentGesture.PanGesture;
                    if (BorderWindow.IsMaximized() == true)
                    {
                        BorderWindow.Maximize(false);
                    }
                    else
                    {
                        BorderWindow.RequestMoveToServer();
                    }
                }
                else if (panGesture.State == Gesture.StateType.Finished || panGesture.State == Gesture.StateType.Cancelled)
                {
                    currentGesture = CurrentGesture.None;
                    ClearWindowGesture();
                }
            }
        }
Esempio n. 2
0
        private void DirectorOnPan(global::System.IntPtr pan)
        {
            var panGesture = new PanGesture(pan, false);

            OnPan?.Invoke(panGesture);
            panGesture.Dispose();
        }
 public void Emit(View arg1, PanGesture arg2)
 {
     Interop.PanGestureDetector.PanGestureDetectedSignalEmit(swigCPtr, View.getCPtr(arg1), PanGesture.getCPtr(arg2));
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Esempio n. 4
0
 public static void SetPanGestureProperties(PanGesture pan)
 {
     Interop.PanGestureDetector.SetPanGestureProperties(PanGesture.getCPtr(pan));
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Esempio n. 5
0
        private bool DirectorOnAccessibilityPan(global::System.IntPtr gesture)
        {
            var panGesture = new PanGesture(gesture, true);
            var ret        = OnAccessibilityPan?.Invoke(panGesture) ?? false;

            panGesture.Dispose();
            return(ret);
        }
Esempio n. 6
0
        internal static PanGesture GetPanGestureFromPtr(global::System.IntPtr cPtr)
        {
            PanGesture ret = new PanGesture(cPtr, false);

            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 7
0
        /// Determines the behavior of borders.
        private void OnPanGestureDetected(object source, PanGestureDetector.DetectedEventArgs e)
        {
            if (e == null)
            {
                return;
            }
            PanGesture panGesture = e.PanGesture;

            if (panGesture.State == Gesture.StateType.Started && panGesture.Position != null)
            {
                direction = BorderWindow.GetDirection(panGesture.Position.X, panGesture.Position.Y);
                if (direction == Window.BorderDirection.Move)
                {
                    if (BorderWindow.IsMaximized() == true)
                    {
                        BorderWindow.Maximize(false);
                    }
                    else
                    {
                        BorderWindow.RequestMoveToServer();
                    }
                }
                else if (direction != Window.BorderDirection.None)
                {
                    OnRequestResize();
                    BorderWindow.RequestResizeToServer((Window.ResizeDirection)direction);
                }
            }
            else if (panGesture.State == Gesture.StateType.Continuing)
            {
                if (direction == Window.BorderDirection.BottomLeft || direction == Window.BorderDirection.BottomRight || direction == Window.BorderDirection.TopLeft || direction == Window.BorderDirection.TopRight)
                {
                    BorderWindow.WindowSize += new Size2D((int)panGesture.ScreenDisplacement.X, (int)panGesture.ScreenDisplacement.Y);
                }
                else if (direction == Window.BorderDirection.Left || direction == Window.BorderDirection.Right)
                {
                    BorderWindow.WindowSize += new Size2D((int)panGesture.ScreenDisplacement.X, 0);
                }
                else if (direction == Window.BorderDirection.Bottom || direction == Window.BorderDirection.Top)
                {
                    BorderWindow.WindowSize += new Size2D(0, (int)panGesture.ScreenDisplacement.Y);
                }
                else if (direction == Window.BorderDirection.Move)
                {
                    BorderWindow.WindowPosition += new Position2D((int)panGesture.ScreenDisplacement.X, (int)panGesture.ScreenDisplacement.Y);
                }
            }
            else if (panGesture.State == Gesture.StateType.Finished || panGesture.State == Gesture.StateType.Cancelled)
            {
                direction = Window.BorderDirection.None;
                ClearWindowGesture();
            }
        }
Esempio n. 8
0
        internal static PanGesture GetPanGestureFromPtr(global::System.IntPtr cPtr)
        {
            PanGesture ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as PanGesture;

            if (ret == null)
            {
                ret = new PanGesture(cPtr, false);
            }
            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 9
0
        /// Determines the behavior of borders.
        private void OnPanGestureDetected(object source, PanGestureDetector.DetectedEventArgs e)
        {
            if (e == null)
            {
                return;
            }
            PanGesture panGesture = e.PanGesture;

            if (panGesture.State == Gesture.StateType.Started && panGesture.Position != null)
            {
                direction = BorderWindow.GetDirection(panGesture.Position.X, panGesture.Position.Y);

                if (direction == Window.BorderDirection.Move)
                {
                    if (BorderWindow.IsMaximized() == true)
                    {
                        BorderWindow.Maximize(false);
                        OnMaximize(false);
                    }
                    else
                    {
                        BorderWindow.RequestMoveToServer();
                    }
                }
                else if (direction != Window.BorderDirection.None && ResizePolicy != Window.BorderResizePolicyType.Fixed)
                {
                    OnRequestResize();
                    BorderWindow.RequestResizeToServer((Window.ResizeDirection)direction);
                }
            }
            else if (panGesture.State == Gesture.StateType.Finished || panGesture.State == Gesture.StateType.Cancelled)
            {
                direction = Window.BorderDirection.None;
                ClearWindowGesture();
            }
        }
Esempio n. 10
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PanGesture obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }