/// <summary> /// Animations the finished. /// </summary> /// <param name="sender">The sender.</param> public void AnimationFinished(object sender) { if (reverse) { if (animationTypes == AnimationTypes.ResizeHoriz) { if (control.GetType() == typeof(System.Windows.Forms.Form)) { animation = new Animation(animationTypes, control, offset * ((offset * 2) + offset - (offset / 2)) /*- control.Width*/, AnimationContinued, duration, Animation_CallBack, startValue, timerInterval, timerPassed, reversed_duration, reversed_timePassed); } else { //-----------WORKING-----------// animation = new Animation(animationTypes, control, offset * ((offset * 2) /* + offset - (offset / 2)*/) /* - control.Width*/, AnimationContinued, duration, Animation_CallBack, startValue, timerInterval, timerPassed, reversed_duration, reversed_timePassed); //-----------WORKING-----------// } } else if (animationTypes == AnimationTypes.ResizeVert) { if (control.GetType() == typeof(System.Windows.Forms.Form)) { animation = new Animation(animationTypes, control, offset * ((offset * 2) + offset - (offset / 2)) /* - control.Height*/, AnimationContinued, duration, Animation_CallBack, startValue, timerInterval, timerPassed, reversed_duration, reversed_timePassed); } else { animation = new Animation(animationTypes, control, offset * ((offset * 2) /* + offset - (offset / 2)*/) /*- control.Height*/, AnimationContinued, duration, Animation_CallBack, startValue, timerInterval, timerPassed, reversed_duration, reversed_timePassed); } } else if (animationTypes == AnimationTypes.MoveLeft) { if (control.GetType() == typeof(System.Windows.Forms.Form)) { locationAnimation = new LocationAnimation(animationTypes, control, offset * ((offset * 2) + offset - (offset / 2)) /*- control.Width*/, mover, AnimationContinued, duration, Animation_CallBack, startValue, timerInterval, timerPassed, reversed_duration, reversed_timePassed); } else { //-----------WORKING-----------// locationAnimation = new LocationAnimation(animationTypes, control, offset * ((offset * 2) /* + offset - (offset / 2)*/) /* - control.Width*/, mover, AnimationContinued, duration, Animation_CallBack, startValue, timerInterval, timerPassed, reversed_duration, reversed_timePassed); //-----------WORKING-----------// } } else if (animationTypes == AnimationTypes.MoveUp) { if (control.GetType() == typeof(System.Windows.Forms.Form)) { locationAnimation = new LocationAnimation(animationTypes, control, offset * ((offset * 2) + offset - (offset / 2)) /* - control.Height*/, mover, AnimationContinued, duration, Animation_CallBack, startValue, timerInterval, timerPassed, reversed_duration, reversed_timePassed); } else { locationAnimation = new LocationAnimation(animationTypes, control, offset * ((offset * 2) /* + offset - (offset / 2)*/) /*- control.Height*/, mover, AnimationContinued, duration, Animation_CallBack, startValue, timerInterval, timerPassed, reversed_duration, reversed_timePassed); } } #region Right and Down else if (animationTypes == AnimationTypes.MoveRight) { if (control.GetType() == typeof(System.Windows.Forms.Form)) { locationAnimation = new LocationAnimation(animationTypes, control, offset * ((offset * 2) + offset - (offset / 2)) /*- control.Width*/, mover, AnimationContinued, duration, Animation_CallBack, startValue, timerInterval, timerPassed, reversed_duration, reversed_timePassed); } else { //-----------WORKING-----------// locationAnimation = new LocationAnimation(animationTypes, control, offset * ((offset * 2) /* + offset - (offset / 2)*/) /* - control.Width*/, mover, AnimationContinued, duration, Animation_CallBack, startValue, timerInterval, timerPassed, reversed_duration, reversed_timePassed); //-----------WORKING-----------// } } else if (animationTypes == AnimationTypes.MoveDown) { if (control.GetType() == typeof(System.Windows.Forms.Form)) { locationAnimation = new LocationAnimation(animationTypes, control, offset * ((offset * 2) + offset - (offset / 2)) /* - control.Height*/, mover, AnimationContinued, duration, Animation_CallBack, startValue, timerInterval, timerPassed, reversed_duration, reversed_timePassed); } else { locationAnimation = new LocationAnimation(animationTypes, control, offset * ((offset * 2) /* + offset - (offset / 2)*/) /*- control.Height*/, mover, AnimationContinued, duration, Animation_CallBack, startValue, timerInterval, timerPassed, reversed_duration, reversed_timePassed); } } #endregion else { if (control.GetType() == typeof(System.Windows.Forms.Form)) { animation = new Animation(animationTypes, control, offset * ((offset * 2) + offset - (offset / 2)), AnimationContinued, duration, Animation_CallBack, startValue, timerInterval, timerPassed, reversed_duration, reversed_timePassed); } else { animation = new Animation(animationTypes, control, offset * ((offset * 2) /* + offset - (offset / 2)*/), AnimationContinued, duration, Animation_CallBack, startValue, timerInterval, timerPassed, reversed_duration, reversed_timePassed); } } } else { } //animation.Reversed(); }
/// <summary> /// Starts this instance. /// </summary> public void Start() { //locationAnimation if (allowCallBack) { if (animationTypes == AnimationTypes.ResizeHoriz) { animation = new Animation(animationTypes, control, offset - control.Width, AnimationFinished, duration, Animation_CallBack, startValue, timerInterval, timerPassed, reversed_duration, reversed_timePassed); } else if (animationTypes == AnimationTypes.ResizeVert) { animation = new Animation(animationTypes, control, offset - control.Height, AnimationFinished, duration, Animation_CallBack, startValue, timerInterval, timerPassed, reversed_duration, reversed_timePassed); } else if (animationTypes == AnimationTypes.MoveLeft) { locationAnimation = new LocationAnimation(animationTypes, control, offset - control.Location.X, mover, AnimationFinished, duration, Animation_CallBack, startValue, timerInterval, timerPassed, reversed_duration, reversed_timePassed); } else if (animationTypes == AnimationTypes.MoveUp) { locationAnimation = new LocationAnimation(animationTypes, control, offset - control.Location.Y, mover, AnimationFinished, duration, Animation_CallBack, startValue, timerInterval, timerPassed, reversed_duration, reversed_timePassed); } else if (animationTypes == AnimationTypes.FadeIn) { animation = new Animation(animationTypes, control, offset - control.Height, AnimationFinished, duration, Animation_CallBack, startValue, timerInterval, timerPassed, reversed_duration, reversed_timePassed); } else if (animationTypes == AnimationTypes.FadeOut) { animation = new Animation(animationTypes, control, offset - control.Height, AnimationFinished, duration, Animation_CallBack, startValue, timerInterval, timerPassed, reversed_duration, reversed_timePassed); } #region Right and Down else if (animationTypes == AnimationTypes.MoveRight) { locationAnimation = new LocationAnimation(animationTypes, control, offset + control.Location.X, mover, AnimationFinished, duration, Animation_CallBack, startValue, timerInterval, timerPassed, reversed_duration, reversed_timePassed); } else if (animationTypes == AnimationTypes.MoveDown) { locationAnimation = new LocationAnimation(animationTypes, control, control.Location.Y + offset, mover, AnimationFinished, duration, Animation_CallBack, startValue, timerInterval, timerPassed, reversed_duration, reversed_timePassed); } #endregion else { animation = new Animation(animationTypes, control, offset, AnimationFinished, duration, Animation_CallBack, startValue, timerInterval, timerPassed, reversed_duration, reversed_timePassed); } } else { if (animationTypes == AnimationTypes.ResizeHoriz) { animation = new Animation(animationTypes, control, offset - control.Width, AnimationFinished, duration); } else if (animationTypes == AnimationTypes.ResizeVert) { animation = new Animation(animationTypes, control, offset - control.Height, AnimationFinished, duration); } else if (animationTypes == AnimationTypes.MoveLeft) { locationAnimation = new LocationAnimation(animationTypes, control, offset - control.Location.X, mover, AnimationFinished, duration); } else if (animationTypes == AnimationTypes.MoveUp) { locationAnimation = new LocationAnimation(animationTypes, control, offset - control.Location.Y, mover, AnimationFinished, duration); } #region Right and Down else if (animationTypes == AnimationTypes.MoveRight) { if (Reverse) { locationAnimation = new LocationAnimation(animationTypes, control, -control.Location.X - (float)Math.Pow(offset, offset / 5), mover, AnimationFinished, duration); } else { locationAnimation = new LocationAnimation(animationTypes, control, control.Location.X + (float)Math.Pow(offset, offset / 5), mover, AnimationFinished, duration); } } else if (animationTypes == AnimationTypes.MoveDown) { if (Reverse) { locationAnimation = new LocationAnimation(animationTypes, control, -control.Location.Y - (float)Math.Pow(offset, offset / 5), mover, AnimationFinished, duration); } else { locationAnimation = new LocationAnimation(animationTypes, control, control.Location.Y + (float)Math.Pow(offset, offset / 5), mover, AnimationFinished, duration); } } #endregion else if (animationTypes == AnimationTypes.FadeIn) { animation = new Animation(animationTypes, control, offset - control.Height, AnimationFinished, duration); } else if (animationTypes == AnimationTypes.FadeOut) { animation = new Animation(animationTypes, control, offset - control.Height, AnimationFinished, duration); } else { animation = new Animation(animationTypes, control, offset, AnimationFinished, duration); } } }