private void DoAnimation() { if (evaluatorHandler == null || evaluatorHandler.Invoke()) { OnAnimationCompleted(); } else { actionHandler.Invoke(); counter++; timer.Start(); } }
protected void Start(Control control, TransitionType transitionType, int duration, AnimationAction actionHandler, AnimationFinishedEvaluator evaluatorHandler) { targetControl = control; this.transitionType = transitionType; this.actionHandler = actionHandler; this.evaluatorHandler = evaluatorHandler; counter = 0; startTime = 0; targetTime = duration; timer = DelayedCall.Start(DoAnimation, duration); }
public static DelayedCall StartAsync(Callback cb, int milliseconds) { DelayedCall dc = CreateAsync(cb, milliseconds); if (milliseconds > 0) { dc.Start(); } else if (milliseconds == 0) { dc.FireNow(); } return(dc); }