protected void SetSubItems(ListItem item, bool forceUpdate) { if (item == null) { return; } HomeMenuGroup group = item.AdditionalProperties[KEY_ITEM_GROUP] as HomeMenuGroup; bool fireChange = false; var actions = _homeProxy.GetGroupActions(group); if (forceUpdate || SubItemsNeedUpdate(_subItems, actions)) { _subItemNavigationList.Clear(); _subItems.Clear(); List <SubItem> subItems = CreateSubItems(actions); CollectionUtils.AddAll(_subItemNavigationList, subItems); CollectionUtils.AddAll(_subItems, subItems); fireChange = true; } FocusCurrentSubItem(item); if (fireChange) { _subItems.FireChange(); } }
protected bool UpdateNavigationList() { _homeProxy.UpdateActions(GetHomeMenuItems()); if (!_homeProxy.GroupsUpdated) { return(false); } ; _navigationList.Clear(); foreach (HomeMenuGroup group in _homeProxy.Groups) { NestedItem item = new NestedItem(Consts.KEY_NAME, group.DisplayName); item.AdditionalProperties[KEY_ITEM_GROUP] = group; _navigationList.Add(item); } //Entry for all actions without a group NestedItem extrasItem = new NestedItem(Consts.KEY_NAME, _homeProxy.OthersName.Evaluate()); _navigationList.Add(extrasItem); return(true); }