public override void TouchesBeganWithEvent(NSEvent aEvent) { if (!Enabled) { return; } NSSet touches = aEvent.TouchesMatchingPhaseinView(NSTouchPhase.Touching, View); if (touches.Count == 2) { iInitialPoint = View.ConvertPointFromBase(aEvent.LocationInWindow); foreach (NSTouch t in touches.ToArray <NSTouch>()) { iInitialTouches.Add(t); iCurrentTouches.Add(t); } } else if (touches.Count > 2) { if (iIsTracking) { CancelTracking(); } } }
public override void TouchesMovedWithEvent(NSEvent aEvent) { if (!Enabled) { return; } iModifiers = aEvent.ModifierFlags; NSSet touches = aEvent.TouchesMatchingPhaseinView(NSTouchPhase.Touching, View); if (touches.Count == 2 && iInitialTouches.Count > 0) { foreach (NSTouch t in touches.ToArray <NSTouch>()) { if (t == iInitialTouches[0]) { iCurrentTouches[0] = t; } else { iCurrentTouches[1] = t; } } if (!iIsTracking) { PointF deltaOrigin = DeltaOrigin(); SizeF deltaSize = DeltaSize(); if (Math.Abs(deltaOrigin.X) > iThreshold || Math.Abs(deltaOrigin.Y) > iThreshold || Math.Abs(deltaSize.Width) > iThreshold || Math.Abs(deltaSize.Height) > iThreshold) { iIsTracking = true; if (EventBegin != null) { EventBegin(this, EventArgs.Empty); } } } else { if (EventUpdate != null) { EventUpdate(this, EventArgs.Empty); } } } }