示例#1
0
        public int AddItem(MenuItemControl item)
        {
            if (null == item.Name)
            {
                item.Name = this.Name;
            }

            item.MenuType   = this.Type;
            item.LeftOffSet = this.LeftOffset;

            return(this.MenuItems.Add(item));
        }
示例#2
0
        protected override void RenderChildren(HtmlTextWriter output)
        {
            this.EnsureChildControls();


            for (int i = 0; i < this.MenuItems.Count; i++)
            {
                MenuItemControl item = this.MenuItems[i];
                if (StaticIndex >= 0)
                {
                    if (i == this.StaticIndex)
                    {
                        item.Selected = true;
                    }
                    else
                    {
                        item.Selected = false;
                    }
                }
                else
                {
                    if (i == this.SelectedIndex)
                    {
                        item.Selected = true;
                    }
                    else
                    {
                        item.Selected = false;
                    }
                }
                if (null == item.NavigateUrl && MenuItemType.Item == item.Type)
                {
                    item.NavigateUrl = "javascript:" + Page.GetPostBackEventReference(this, i.ToString());
                }
            }
            base.RenderChildren(output);
        }
示例#3
0
 protected internal void Remove(MenuItemControl item)
 {
     this.List.Remove(item);
 }
示例#4
0
 protected internal int Add(MenuItemControl item)
 {
     return(this.List.Add(item));
 }