/// <summary>
        /// Start animation.
        /// </summary>
        /// <param name="control">Control to use.</param>
        /// <param name="transitionType">TransitionType instance.</param>
        /// <param name="duration">Duration time in milliseconds.</param>
        /// <param name="actionHandler">AnimationAction delegate.</param>
        /// <param name="evaluatorHandler">AnimationFinishedEvaluator delegate.</param>
        protected void Start(Control control, TransitionType transitionType, int duration, AnimationAction actionHandler, AnimationFinishedEvaluator evaluatorHandler)
        {
            this._targetControl    = control;
            this.TransitionType    = transitionType;
            this._actionHandler    = actionHandler;
            this._evaluatorHandler = evaluatorHandler;

            this.Counter    = 0;
            this.StartTime  = 0;
            this.TargetTime = duration;

            this._timer = DelayedCall.Start(this.DoAnimation, duration);
        }
Example #2
0
        public static DelayedCall StartAsync(Callback callback, int interval)
        {
            DelayedCall result = CreateAsync(callback, interval);

            if (interval > 0)
            {
                result.Start();
            }
            else if (interval == 0)
            {
                result.FireNow();
            }

            return(result);
        }