Ejemplo n.º 1
0
 public static TimedAnimator <T> WhenFinished <T>(this TimedAnimator <T> animator, Action <TimedAnimator <T> > action)
 {
     return(new DelegateTimedAnimator <T>(t =>
     {
         var res = animator.Animate(TimeSpan.FromMilliseconds(t * animator.TotalDuration.TotalMilliseconds));
         if (animator.Finished)
         {
             action(animator);
         }
         return res;
     }, animator.TotalDuration, animator.StartValue, animator.AnimatorType));
 }
Ejemplo n.º 2
0
 public static TimedAnimator <T> ContinueWith <T>(this TimedAnimator <T> first, TimedAnimator <T> next)
 => new ContinuationTimedAnimator <T>(next, first);
Ejemplo n.º 3
0
 public static TimedAnimator <T> Add <T>(this TimedAnimator <T> first, IAnimator <double> second)
 => new DelegateTimedAnimator <T>(input => first.Animate(second.Animate(input)), first.TotalDuration, first.CurrentValue, first.AnimatorType);
Ejemplo n.º 4
0
 public static TimedAnimator <T> ContinueWith <T>(this TimedAnimator <T> first, Func <double, T> function)
 => new ContinuationTimedAnimator <T>(function.FromDelegate().ToTimed(first.TotalDuration, first.StartValue, first.AnimatorType), first);
Ejemplo n.º 5
0
 public ContinuationTimedAnimator(TimedAnimator <T> nextAnimator, TimedAnimator <T> baseAnimator)
     : base(baseAnimator.TotalDuration, baseAnimator.StartValue, baseAnimator.AnimatorType)
 {
     _NextAnimator = nextAnimator;
     _baseAnimator = baseAnimator;
 }