private void StartProcessingGesture() { DetermineNextPosition(); DetermineNextY(); Debug.Log("Gesture detected! Next position: " + _nextPosition); _processingGesture = true; PositionChanging.Raise(_nextPosition); }
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)); }
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); } }
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); }
/// <summary> /// Fires the Position Changing event while either slider is being dragged. /// </summary> protected virtual void OnPositionChanging() { PositionChanging?.Invoke(this, EventArgs.Empty); }