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; }
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(); } }
public CVector(CPoint from, CPoint to) { XProjection = to.X - from.X; YProjection = to.Y - from.Y; }