Beispiel #1
0
 public void AnimatePositionControlLocationTest()
 {
     Point activeLocation = new Point(10, 10);
     AnimatePositionControl animatePositionControl = new AnimatePositionControl(ctrToBeTested, activeLocation, 0);
     animatePositionControl.MoveToActivePosition();
     if (ctrToBeTested.Location == activeLocation)
     {
         Assert.Pass();
     }
     else
     {
         Assert.Fail();
     }
 }
        /// <summary>
        /// Creates a side menu on the left, adding it to the form.
        /// </summary>
        /// <param name="currentForm">The form that will receive the side menu</param>
        /// <param name="opened">Is the menu open upton serialization</param>
        public SideMenu(Form currentForm, bool opened)
        {
            InicializePanel(currentForm);
            InicializeBorders();
            InicializeClassButton();
            InicializeSideMenuOptions();
            InicializeCurrentClass();
            SetControlsCorrectOrder();

            menuOpenCloseMenuAnimation    = new AnimatePositionControl(menuPanel, new Point(menuPanel.Location.X - (menuPanel.Width - 60), 0), 0);
            menuButtonGrowShrinkAnimation = new AnimateSizeControl(menuCloseOpenButton, new Size(menuCloseOpenButton.Size.Width + 10, menuCloseOpenButton.Size.Height + 10), 0, true);
            classSelectionmenu            = new AnimateSizeControl(currentClassGFX, new Size(currentClassGFX.Size.Width, currentClassGFX.Height + 500), 5, false);

            menuOpenCloseMenuAnimation.OnActiveAnimationEnds    += ExtendButtonLabel;
            menuOpenCloseMenuAnimation.OnDefaultAnimationStarts += CollapseButtonLabel;

            if (!opened)
            {
                menuOpenCloseMenuAnimation.MoveToActivePosition();
            }
        }