Exemplo n.º 1
0
        private void OpenUsersToAdd()
        {
            //close child of mdi if there is one active
            if (ActiveMdiChild != null)
            {
                if (ActiveMdiChild is PeopleForm)
                {
                    //click on the add button
                    PeopleForm form = (PeopleForm)ActiveMdiChild;
                    Button button = form.Controls.Find("addUserPeopleButton", true).FirstOrDefault() as Button;
                    if (button != null)
                    {
                        button.PerformClick();
                    }
                }
                else
                {
                    //Close child
                    ActiveMdiChild.Close();

                    //create new instance of form
                    peopleForm = new PeopleForm(this, true);

                    //Show people form and maximize it instantly
                    peopleForm.Show();
                    peopleForm.WindowState = FormWindowState.Maximized;
                }
            }

            ResetProgressBar();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Opens the people page.
        /// </summary>
        private void OpenPeoplePage()
        {
            //create new instance of form
            peopleForm = new PeopleForm(this);

            //close child of mdi if there is one active
            if (ActiveMdiChild != null)
            {
                if (ActiveMdiChild is PeopleForm)
                {
                    //Do Nothing
                }
                else
                {
                    //Close child
                    ActiveMdiChild.Close();
                }
            }

            //Show people form and maximize it instantly
            peopleForm.Show();
            peopleForm.WindowState = FormWindowState.Maximized;

            ResetProgressBar();
        }