Example #1
0
        /// <param name = "mgMenu">EntryName EntryName to be checked</param>
        /// <param name = "entryName">EntryName to be checked</param>
        /// <returns> Returns true if specified entry name is found in top level menu</returns>
        private bool IsTopLevelMenu(MgMenu mgMenu, String entryName)
        {
            bool found = false;

            IEnumerator iMenuEntry = mgMenu.iterator();

            while (!found && iMenuEntry.MoveNext())
            {
                MenuEntry menuEntry = (MenuEntry)iMenuEntry.Current;
                String    menuName  = menuEntry.getName();

                if (menuName != null && String.CompareOrdinal(menuName, entryName) == 0)
                {
                    found = true;
                }
            }

            return(found);
        }
Example #2
0
        /// <summary>
        ///   Search and remove menu entries that are found in delMenu.
        /// </summary>
        /// <param name = "delMenu">Menu  to be deleted.</param>
        /// <param name = "menuPos">menu from which menu entries to be deleted</param>
        /// <param name = "form">Frame window</param>
        private void SearchAndRemoveMenuEntries(int idx, MgMenu delMenu, object menuPos, MgFormBase form)
        {
            IEnumerator iDelMenuEntry = delMenu.iterator();

            while (iDelMenuEntry.MoveNext())
            {
                IEnumerator iMenuEntry;
                MenuEntry   delMenuEntry = (MenuEntry)iDelMenuEntry.Current;
                String      delMenuName  = delMenuEntry.TextMLS;

                if (menuPos is MgMenu)
                {
                    iMenuEntry = ((MgMenu)menuPos).iterator();
                }
                else
                {
                    iMenuEntry = ((MenuEntryMenu)menuPos).iterator();
                }

                SearchAndRemoveMenuEntry(idx, iMenuEntry, delMenuName, menuPos, form);
            }
        }