public KeyFrameAnimationInstance( IInterpolator <T> interpolator, ServerKeyFrame <T>[] keyFrames, PropertySetSnapshot snapshot, ExpressionVariant?finalValue, ServerObject target, AnimationDelayBehavior delayBehavior, TimeSpan delayTime, PlaybackDirection direction, TimeSpan duration, AnimationIterationBehavior iterationBehavior, int iterationCount, AnimationStopBehavior stopBehavior) : base(target, snapshot) { _interpolator = interpolator; _keyFrames = keyFrames; _finalValue = finalValue; _delayBehavior = delayBehavior; _delayTime = delayTime; _direction = direction; _duration = duration; _iterationBehavior = iterationBehavior; _iterationCount = iterationCount; _stopBehavior = stopBehavior; if (_iterationBehavior == AnimationIterationBehavior.Count) { _totalDuration = delayTime.Add(TimeSpan.FromTicks(iterationCount * _duration.Ticks)); } if (_keyFrames.Length == 0) { throw new InvalidOperationException("Animation has no key frames"); } if (_duration.Ticks <= 0) { throw new InvalidOperationException("Invalid animation duration"); } }
public ExpressionAnimationInstance(Expression expression, ServerObject target, ExpressionVariant?finalValue, PropertySetSnapshot parameters) : base(target, parameters) { _expression = expression; _finalValue = finalValue; }