/// <summary>
 /// Gets the value for step.
 /// </summary>
 /// <param name="step">The step.</param>
 /// <returns>System.Object.</returns>
 protected override object GetValueForStep(double step)
 {
     if (this._startColor == Color.Empty || this._endColor == Color.Empty)
     {
         return(this.CurrentValue);
     }
     return((object)AnimatorBase.InterpolateColors(this._startColor, this._endColor, step));
 }
 /// <summary>
 /// Removes the child animator.
 /// </summary>
 /// <param name="animator">The animator.</param>
 /// <exception cref="System.ArgumentNullException">animator</exception>
 protected void RemoveChildAnimator(AnimatorBase animator)
 {
     if (animator == null)
     {
         throw new ArgumentNullException(nameof(animator));
     }
     if (!this._childAnimators.Contains((object)animator))
     {
         return;
     }
     this._childAnimators.Remove((object)animator);
 }
 /// <summary>
 /// Adds the child animator.
 /// </summary>
 /// <param name="animator">The animator.</param>
 /// <exception cref="System.ArgumentNullException">animator</exception>
 protected void AddChildAnimator(AnimatorBase animator)
 {
     if (animator == null)
     {
         throw new ArgumentNullException(nameof(animator));
     }
     if (!this._childAnimators.Contains((object)animator))
     {
         this._childAnimators.Add((object)animator);
     }
     animator.SetIntervall(this.Intervall, false);
     animator.SetStepSize(this.StepSize, false);
     animator.SetLoopMode(this.LoopMode, false);
     animator.SetSynchronizationMode(this.SynchronizationMode, false);
 }
 /// <summary>
 /// Gets the value for step.
 /// </summary>
 /// <param name="step">The step.</param>
 /// <returns>System.Object.</returns>
 protected override object GetValueForStep(double step)
 {
     return((object)this.CheckValue(AnimatorBase.InterpolateIntegerValues(this._startValue, this._endValue, step)));
 }
 /// <summary>
 /// Interpolates the sizes.
 /// </summary>
 /// <param name="size1">The size1.</param>
 /// <param name="size2">The size2.</param>
 /// <param name="percent">The percent.</param>
 /// <returns>Size.</returns>
 public static Size InterpolateSizes(Size size1, Size size2, double percent)
 {
     return(new Size(AnimatorBase.InterpolateIntegerValues(size1.Width, size2.Width, percent), AnimatorBase.InterpolateIntegerValues(size1.Height, size2.Height, percent)));
 }
 /// <summary>
 /// Interpolates the points.
 /// </summary>
 /// <param name="point1">The point1.</param>
 /// <param name="point2">The point2.</param>
 /// <param name="percent">The percent.</param>
 /// <returns>Point.</returns>
 public static Point InterpolatePoints(Point point1, Point point2, double percent)
 {
     return(new Point(AnimatorBase.InterpolateIntegerValues(point1.X, point2.X, percent), AnimatorBase.InterpolateIntegerValues(point1.Y, point2.Y, percent)));
 }
 /// <summary>
 /// Interpolates the rectangles.
 /// </summary>
 /// <param name="rectangle1">The rectangle1.</param>
 /// <param name="rectangle2">The rectangle2.</param>
 /// <param name="percent">The percent.</param>
 /// <returns>Rectangle.</returns>
 public static Rectangle InterpolateRectangles(Rectangle rectangle1, Rectangle rectangle2, double percent)
 {
     return(new Rectangle(AnimatorBase.InterpolatePoints(rectangle1.Location, rectangle2.Location, percent), AnimatorBase.InterpolateSizes(rectangle1.Size, rectangle2.Size, percent)));
 }
 /// <summary>
 /// Interpolates the colors.
 /// </summary>
 /// <param name="color1">The color1.</param>
 /// <param name="color2">The color2.</param>
 /// <param name="percent">The percent.</param>
 /// <returns>Color.</returns>
 public static Color InterpolateColors(Color color1, Color color2, double percent)
 {
     return(Color.FromArgb(AnimatorBase.InterpolateIntegerValues((int)color1.A, (int)color2.A, percent), AnimatorBase.InterpolateIntegerValues((int)color1.R, (int)color2.R, percent), AnimatorBase.InterpolateIntegerValues((int)color1.G, (int)color2.G, percent), AnimatorBase.InterpolateIntegerValues((int)color1.B, (int)color2.B, percent)));
 }
示例#9
0
 /// <summary>
 /// Gets the value for step.
 /// </summary>
 /// <param name="step">The step.</param>
 /// <returns>System.Object.</returns>
 protected override object GetValueForStep(double step)
 {
     return((object)AnimatorBase.InterpolateDoubleValues(this._startOpacity, this._endOpacity, step));
 }
 /// <summary>
 /// Gets the value for step.
 /// </summary>
 /// <param name="step">The step.</param>
 /// <returns>System.Object.</returns>
 protected override object GetValueForStep(double step)
 {
     return((object)AnimatorBase.InterpolateRectangles(this._startBounds, this._endBounds, step));
 }