Exemplo n.º 1
0
        private void DoAnimation()
        {
            if (evaluatorHandler == null || evaluatorHandler.Invoke())
            {
                OnAnimationCompleted();
            }
            else
            {
                actionHandler.Invoke();
                counter++;

                timer.Start();
            }
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 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);
        }