Exemplo n.º 1
0
    private void StartProcessingGesture()
    {
        DetermineNextPosition();
        DetermineNextY();

        Debug.Log("Gesture detected! Next position: " + _nextPosition);
        _processingGesture = true;
        PositionChanging.Raise(_nextPosition);
    }
Exemplo n.º 2
0
 public override bool ReLocate(LanePotision lane, TimingPosition timing)
 {
     if (PositionChanging is null)
     {
         return(false);
     }
     if (!PositionChanging.Invoke(this, lane, timing))
     {
         timing = Timing;
     }
     return(base.ReLocate(lane, timing));
 }
Exemplo n.º 3
0
 private void SetPosition(int percent, bool raiseEvent)
 {
     _position = (percent / (float)this.Width) * _duration;
     _position = Math.Max(0, _position);
     _position = Math.Min(_position, _duration);
     if (raiseEvent)
     {
         PositionChanged?.Invoke(this, EventArgs.Empty);
     }
     else
     {
         PositionChanging?.Invoke(this, EventArgs.Empty);
     }
 }
Exemplo n.º 4
0
        private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
        {
            switch (msg)
            {
            case WM_SIZE:
                SizeChanged?.Invoke(this, new HwndInteropSizeChangedEventArgs((HwndInteropSizeChangedEventArgs.ResizeRequestType)wParam));
                break;

            case WM_WINDOWPOSCHANGING:
                WINDOWPOS windowPos = (WINDOWPOS)Marshal.PtrToStructure(lParam, typeof(WINDOWPOS));
                PositionChanging?.Invoke(this, new HwndInteropPositionChangingEventArgs((HwndInteropPositionChangingEventArgs.PositionChangeType)windowPos.flags));
                break;
            }

            return(IntPtr.Zero);
        }
Exemplo n.º 5
0
 /// <summary>
 /// Fires the Position Changing event while either slider is being dragged.
 /// </summary>
 protected virtual void OnPositionChanging()
 {
     PositionChanging?.Invoke(this, EventArgs.Empty);
 }