Example #1
0
        /// <summary>
        ///   This method creates the gui commands in order to delete the matching menu object.
        /// </summary>
        /// <param name = "menuStyle"></param>
        public void deleteMenuEntryObject(MgFormBase form, MenuStyle menuStyle)
        {
            if (this is MenuEntryMenu)
            {
                //MenuReference menuItemReference = getInstantiatedMenuItem(form, menuStyle);
                for (int i = 0;
                     i < ((MenuEntryMenu)this).subMenus.Count;
                     i++)
                {
                    MenuEntry subMenuEntry = (((MenuEntryMenu)this).subMenus[i]);
                    subMenuEntry.deleteMenuEntryObject(form, menuStyle);
                }

                //if (menuItemReference != null && ((form.ShouldShowPullDownMenu && menuStyle == MenuStyle.MENU_STYLE_PULLDOWN) ||
                //                                  (menuStyle == MenuStyle.MENU_STYLE_CONTEXT)))
                //{
                //   cmdQueue.add(CommandType.DELETE_MENU, menuItemReference, this, true);
                //   cmdQueue.execute();
                //}
            }

            deleteMenuEntryObjectItem(form, menuStyle);
            //      deleteMenuEntryObjectItems(parentMenuObject, MenuStyle.MENU_STYLE_CONTEXT);
            if (menuStyle == MenuStyle.MENU_STYLE_PULLDOWN && form.ShouldCreateToolbar)
            {
                deleteMenuEntryTool(form, true, false);
            }
        }