/// <summary> /// Calculating different zoom factors /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected override void FireSucessful(object sender, GestureEventArgs e) { if(Math.Abs(_start - -1.0) < EPSILON) { _start = ((InternalZoomGestureEventArgs)e).Gauge; _last = ((InternalZoomGestureEventArgs)e).Gauge; } else { //Debug.WriteLine("start: " + start + " last: " + last); if (Successful != null) Successful(this, new ZoomGestureEventArgs { ZoomFactorFromBegin = ((InternalZoomGestureEventArgs)e).Gauge/_start, ZoomFactorFromLast = ((InternalZoomGestureEventArgs)e).Gauge/_last }); _last = ((InternalZoomGestureEventArgs)e).Gauge; } }
/// <summary> /// Indicate a call to registered Success Eventhandlers</summary> /// <param name="sender"> /// Probably an implementation of the GestureChecker class</param> /// <param name="e"> /// Detailed arguments for a gesture part</param> protected void FireSucceeded(object sender, GestureEventArgs e) { if (Succeeded != null) { Succeeded(sender, e); } }
/// <summary> /// Current gesture part was sucessful. Continue with next.</summary> /// <param name="src"> /// The checked condition</param> /// <param name="e"> /// Details about the success</param> private void ConditionComplete(Object src, GestureEventArgs e) { Condition previous = index.Current; Boolean hasNext = index.MoveNext(); Condition next = index.Current; if (hasNext) // no further gesture parts -> success! { previous.Disable(); next.Enable(); } else { Reset(); FireSucessful(this, e); } }
protected virtual void FireSucessful(Object sender, GestureEventArgs e) { e.Person = _p; if (Successful != null) { Successful(this, e); } }