void Menu_AfterItemAdd(MenuBase item) { item.Items.AfterItemAdd += MenuItems_AfterItemAdd; }
/* Methods * -----------------------------------------------------------------------------------------------*/ /// <summary> /// /// </summary> /// <param name="menu"></param> /// <returns></returns> public virtual DefaultTabMenuCollectionBuilder <TParent, TParentBuilder> Add(MenuBase menu) { this.Owner.DefaultTabMenu.Add(menu); return(this); }
/// <summary> /// Set a child menu for this item. See the menu configuration. /// </summary> /// <param name="menu">A menu, or menu configuration. null may be passed to remove the menu.</param> /// <param name="destroyMenu">True to destroy any existing menu. False to prevent destruction. If not specified, the destroyMenu configuration will be used.</param> public virtual void SetMenu(MenuBase menu, bool destroyMenu) { this.Call("setMenu", menu != null ? menu.ToConfig() : null, destroyMenu); }
/// <summary> /// Set a child menu for this item. See the menu configuration. /// </summary> /// <param name="menu">A menu, or menu configuration. null may be passed to remove the menu.</param> public virtual void SetMenu(MenuBase menu) { this.Call("setMenu", menu != null ? menu.ToConfig() : null); }
public virtual TBuilder Menu(MenuBase menu) { this.ToComponent().Menu.Add(menu); return(this as TBuilder); }
/* Methods * -----------------------------------------------------------------------------------------------*/ /// <summary> /// /// </summary> /// <param name="menu"></param> /// <returns></returns> public virtual MenuItemBaseMenuCollectionBuilder <TParent, TParentBuilder> Add(MenuBase menu) { this.Owner.Menu.Add(menu); return(this); }
protected virtual void AfterItemRemove(MenuBase item) { if (this.Controls.Contains(item)) { this.Controls.Remove(item); } if (this.LazyItems.Contains(item)) { this.LazyItems.Remove(item); } }
protected virtual void AfterItemAdd(MenuBase item) { if (!this.Controls.Contains(item)) { this.Controls.Add(item); } if (!this.LazyItems.Contains(item)) { this.LazyItems.Add(item); } }