Beispiel #1
0
        protected void Start(Control control, TransitionType transitionTypee, int duration, AnimationAction actionHandlerr, AnimationFinishedEvaluator evaluatorHandlerr)
        {
            targetControl    = control;
            transitionType   = transitionTypee;
            actionHandler    = actionHandlerr;
            evaluatorHandler = evaluatorHandlerr;

            counter    = 0;
            startTime  = 0;
            targetTime = duration;

            timer = DelayedCall.Start(DoAnimation, duration);
        }
Beispiel #2
0
        private void DoAnimation()
        {
            if (evaluatorHandler == null || evaluatorHandler.Invoke())
            {
                OnAnimationCompleted();
            }
            else
            {
                actionHandler.Invoke();
                counter++;

                timer.Start();
            }
        }
Beispiel #3
0
        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);
        }