示例#1
0
        public void MainMenu_GetForm_AddedToForm_ReturnsExpected()
        {
            var form = new Form
            {
                Menu = new MainMenu()
            };

            MainMenu menu = form.Menu;

            Assert.Equal(form, menu.GetForm());
            Assert.Equal(form, menu.GetFormUnsafe());
        }
        internal Form[] FindMdiForms()
        {
            Form[]   mdiChildren = null;
            MainMenu mainMenu    = base.GetMainMenu();
            Form     formUnsafe  = null;

            if (mainMenu != null)
            {
                formUnsafe = mainMenu.GetFormUnsafe();
            }
            if (formUnsafe != null)
            {
                mdiChildren = formUnsafe.MdiChildren;
            }
            if (mdiChildren == null)
            {
                mdiChildren = new Form[0];
            }
            return(mdiChildren);
        }