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)); }
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); }
protected internal void Remove(MenuItemControl item) { this.List.Remove(item); }
protected internal int Add(MenuItemControl item) { return(this.List.Add(item)); }