Exemplo n.º 1
0
        public Boolean AddMenuItem(Int32 sectionID, MenuItemInfo menuItem)
        {
            Boolean isOk = false;

            if (menuItem.IsNew)
            {
                MenuSectionInfo section = FindSectionByID(sectionID);

                if (section != null && !section.IsNew)
                {
                    menuItem.ID = ++_nextItemID;

                    isOk = section.AddMenuItem(menuItem);
                }
            }

            return isOk;
        }
Exemplo n.º 2
0
        public Boolean MoveUp(MenuItemInfo menuItem)
        {
            Boolean isOk = false;

            Int32 menuItemIndex = _items.IndexOf(menuItem);

            if (menuItemIndex > 0)
            {
                _items.RemoveAt(menuItemIndex);
                _items.Insert(menuItemIndex - 1, menuItem);

                isOk = true;
            }

            return isOk;
        }
Exemplo n.º 3
0
        public Boolean AddMenuItem(MenuItemInfo menuItem)
        {
            Boolean isOk = false;

            if (menuItem.IsNew)
            {
                _items.Add(menuItem);

                isOk = true;
            }

            return isOk;
        }
Exemplo n.º 4
0
        public Boolean MoveDown(MenuItemInfo menuItem)
        {
            Boolean isOk = false;

            Int32 menuItemIndex = _items.IndexOf(menuItem);

            if (menuItemIndex >= 0 && menuItemIndex < (_items.Count - 1))
            {
                _items.RemoveAt(menuItemIndex);
                _items.Insert(menuItemIndex + 1, menuItem);

                isOk = true;
            }

            return isOk;
        }
Exemplo n.º 5
0
        public MenuInfo GetMenuInfo()
        {
            MenuInfo menu = new MenuInfo();
            menu.Bullet = VerticalMenuBulletType.Sun;

            MenuSectionInfo section = new MenuSectionInfo(menu);
            section.Title = "Other Contacts";

            foreach (ContactFormData formData in FormsData)
            {
                if (formData.IsDisplayInMenu)
                {
                    MenuItemInfo menuItem = new MenuItemInfo();

                    menuItem.Title = formData.Name;
                    menuItem.Href = LinkUtils.ResolveClientUrl(String.Format(Settings.Forms.ContactUs.UrlTemplate, formData.ID));

                    section.AddMenuItem(menuItem);
                }
            }

            menu.AddSection(section);

            return menu;
        }