/// <summary> /// Starts the specified form. /// </summary> /// <param name="Form">The form.</param> public void Start(System.Windows.Forms.Form Form) { form = Form; FormAnimations formAnimation = new FormAnimations(Form, Time.Time, Time.StepX, Time.StepY); switch (Animation) { case FormAnimationTypes.LeftToRight: formAnimation.Left2Right(Positions.Start, Positions.End); break; case FormAnimationTypes.RightToLeft: formAnimation.Right2Left(Positions.Start, Positions.End); break; case FormAnimationTypes.TopToBottom: formAnimation.Top2Bottom(Positions.Start, Positions.End); break; case FormAnimationTypes.BottomToTop: formAnimation.Bottom2Top(Positions.Start, Positions.End); break; case FormAnimationTypes.FadeIn: formAnimation.FadeIn(Opacity.Start, Opacity.Step); break; case FormAnimationTypes.FadeOut: formAnimation.FadeOut(Opacity.Start, Opacity.Step); Form.Opacity = 1; break; case FormAnimationTypes.HideControls: FormAnimations.HideControls(Form, Time.Time, false); break; case FormAnimationTypes.ShowControls: FormAnimations.ShowControls(Form, Time.Time, false); break; case FormAnimationTypes.GrowHorizontal: formAnimation.GrowHorizontal(Grow.Start, Grow.End, Grow.FixWindowWhenGrown); System.Threading.Thread.Sleep(1000); break; case FormAnimationTypes.GrowVertical: formAnimation.GrowVertical(Grow.Start, Grow.End, Grow.FixWindowWhenGrown); System.Threading.Thread.Sleep(1000); break; case FormAnimationTypes.GrowXY: formAnimation.GrowXY(Grow.StartPoint, Grow.EndPoint, Grow.FixWindowWhenGrown); System.Threading.Thread.Sleep(1000); break; case FormAnimationTypes.ShrinkHorizontal: formAnimation.ShrinkHorizontal(Positions.Start, Positions.End); System.Threading.Thread.Sleep(1000); break; case FormAnimationTypes.ShrinkVertical: formAnimation.ShrinkVertical(Positions.Start, Positions.End); System.Threading.Thread.Sleep(1000); break; case FormAnimationTypes.ShrinkXY: formAnimation.ShrinkXY(Positions.StartPoint, Positions.EndPoint); System.Threading.Thread.Sleep(1000); break; case FormAnimationTypes.Move: if (MoveToPoint) { formAnimation.Move(Move.RandomLocations, Move.DirectTrajectory); System.Threading.Thread.Sleep(1000); } else { formAnimation.Move(Move.StartPoint, Move.EndPoint, Move.DirectTrajectory); System.Threading.Thread.Sleep(1000); } break; case FormAnimationTypes.GrowMoveXY: formAnimation.GrowMoveXY(Grow.StartPoint, Grow.Size, Grow.Recalculate); System.Threading.Thread.Sleep(2000); break; case FormAnimationTypes.ShrinkMoveXY: formAnimation.ShrinkMoveXY(Positions.StartPoint, Positions.Size, Positions.ShrinkToCenter); System.Threading.Thread.Sleep(2000); break; case FormAnimationTypes.Shake: switch (Shake.ShakeType) { case ShakeType.Horizontal: formAnimation.ShakeIt(Form.Location, new Point(Form.Location.X + Shake.ShakeDistance, Form.Location.Y), Time.Time * Shake.ShakeSpeed); System.Threading.Thread.Sleep(1000); break; case ShakeType.Vertical: formAnimation.ShakeIt(Form.Location, new Point(Form.Location.X, Form.Location.Y + Shake.ShakeDistance), Time.Time * Shake.ShakeSpeed); System.Threading.Thread.Sleep(1000); break; case ShakeType.Both: formAnimation.ShakeIt(Time.Time * Shake.ShakeSpeed / 2); System.Threading.Thread.Sleep(1000); break; default: break; } break; case FormAnimationTypes.ShrinkFadeOut: //System.Threading.Thread shakeFOutt1 = new System.Threading.Thread(new System.Threading.ThreadStart(Shk)); //System.Threading.Thread shakeFOutt2 = new System.Threading.Thread(new System.Threading.ThreadStart(FOut)); //shakeFOutt1.Start(); //shakeFOutt2.Start(); //shakeFOutt1.Join(); //shakeFOutt2.Join(); //System.Threading.Thread.Sleep(500); //Form.Opacity = 1; formAnimation = new FormAnimations(Form, 15); formAnimation.ShrinkXY(); System.Threading.Thread.Sleep(50); formAnimation = new FormAnimations(Form, 50); formAnimation.FadeOut(101, 3); System.Threading.Thread.Sleep(500); Form.Opacity = 1; System.Threading.Thread.Sleep(1000); break; case FormAnimationTypes.DeterminerPosition: switch (Locations.FormLocations) { case FormLocations.TopLeft: Form.Location = formAnimation.DeterminarPos(Constantes.TopLeft); System.Threading.Thread.Sleep(300); break; case FormLocations.TopRight: Form.Location = formAnimation.DeterminarPos(Constantes.TopRight); System.Threading.Thread.Sleep(300); break; case FormLocations.BottomLeft: Form.Location = formAnimation.DeterminarPos(Constantes.BottomLeft); System.Threading.Thread.Sleep(300); break; case FormLocations.BottomRight: Form.Location = formAnimation.DeterminarPos(Constantes.BottomRight); System.Threading.Thread.Sleep(300); break; case FormLocations.TopCenter: Form.Location = formAnimation.DeterminarPos(Constantes.TopCenter); System.Threading.Thread.Sleep(300); break; case FormLocations.BottomCenter: Form.Location = formAnimation.DeterminarPos(Constantes.BottomCenter); System.Threading.Thread.Sleep(300); break; case FormLocations.LeftCenter: Form.Location = formAnimation.DeterminarPos(Constantes.LeftCenter); System.Threading.Thread.Sleep(300); break; case FormLocations.RightCenter: Form.Location = formAnimation.DeterminarPos(Constantes.RightCenter); System.Threading.Thread.Sleep(300); break; case FormLocations.RandomPoint: Form.Location = formAnimation.DeterminarPos(Constantes.RndPoint); System.Threading.Thread.Sleep(300); break; case FormLocations.CenterScreen: Form.Location = formAnimation.DeterminarPos(Constantes.CenterScreen); System.Threading.Thread.Sleep(300); break; } break; case FormAnimationTypes.LeftToRightVertical: //System.Threading.Thread t1 = new System.Threading.Thread(new System.Threading.ThreadStart(L2R)); //System.Threading.Thread t2 = new System.Threading.Thread(new System.Threading.ThreadStart(GrowV)); //t1.Start(); //t2.Start(); formAnimation.Left2Right(0, formAnimation.DeterminarPos(Constantes.CenterScreen).X); formAnimation.GrowVertical(0, form.Height, false); break; } }