예제 #1
0
 public CPointAnimator(T animatable, CPoint from, CPoint to, TimeSpan totalDuration)
 {
     if (totalDuration <= TimeSpan.Zero)
     {
         throw new ArgumentException("Total duration value should be more than zero");
     }
     Animatable    = animatable;
     From          = from;
     To            = to;
     TotalDuration = totalDuration;
     State         = EAnimatorState.Unstarted;
 }
예제 #2
0
 public void ProlongAnimation(CPoint from, CPoint to, TimeSpan totalDuration)
 {
     lock (_locker)
     {
         if (State != EAnimatorState.Running)
         {
             throw new InvalidOperationException($"Cannot prolong animation because it {State}");
         }
         CancelAnimation();
         From          = from;
         To            = to;
         TotalDuration = totalDuration;
         BeginAnimation();
     }
 }
예제 #3
0
 public CVector(CPoint from, CPoint to)
 {
     XProjection = to.X - from.X;
     YProjection = to.Y - from.Y;
 }