private TagBuilder ParentTag(IParentItem parent) { var mainTag = new TagBuilder("li"); var label = new TagBuilder("label"); label.SetInnerText(parent.MenyText()); label.AddCssClass(" nav-header"); var editButtons = new TagBuilder("div"); if (parent is IEditableItem && ShowEdit) { editButtons.InnerHtml += EditTag((IEditableItem)parent); } var children = new TagBuilder("ul"); foreach (var child in parent.ToList()) { children.InnerHtml += BuildHtml(child); } mainTag.InnerHtml += SetColoumns(label, editButtons, MakeRow(new TagBuilder("div"))); mainTag.InnerHtml += MakeRow(children); return(mainTag); }
/// <summary> /// Set focus from this parent menu item /// </summary> /// <param name="menuItem">Menu item.</param> /// <param name="OnExit">Action to do when dialog exits</param> public void SetFocus(IParentItem menuItem, Action <DialogType> OnExit = null) { this.OnExit = OnExit; Parent = menuItem; hasFocus = true; Parent.SetFocus(this); }
public DestinatarioAreaTreeViewModel(TrancingAsuntoTurnoViewModel trancingAsuntoTurnoViewModel, IParentItem Parent) { this._TrancingAsuntoTurnoViewModel = trancingAsuntoTurnoViewModel; this.Children = new ObservableCollection<DestinatarioItemViewModel>(); this._OrganigramaRepository = new GestorDocument.DAL.Repository.OrganigramaRepository(); this.Rol = trancingAsuntoTurnoViewModel._ParentAsunto._PantallaInicioViewModel._MainWindowViewModel.Usuario.Rol; this.TipoUnidadNormativa = trancingAsuntoTurnoViewModel._ParentAsunto._PantallaInicioViewModel._MainWindowViewModel.Usuario.Rol.Organigrama.TipoUnidadNormativa; this.Parent = Parent; this.AddItem = new ObservableCollection<OrganigramaModel>(); this.GetBrothers(); }
/// <summary> /// Add resource to the Swix root. /// </summary> /// <param name="resource">Resource to process.</param> private void ProcessResource(Resource resource) { this.Items.Add(resource); IParentItem parent = resource as IParentItem; if (parent != null) { foreach (PackageItem item in parent.EnumItems) { ProcessItem(item); } } }
public static List <IParentItem> GetAllChildren(IParentItem parent) { var list = new List <IParentItem>(); foreach (var child in parent.ToList()) { if (child is IParentItem) { list.Add((IParentItem)child); list = list.Concat(GetAllChildren((IParentItem)child)).ToList(); } } return(list); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void HandleItemSelected(IItemGroup pLevel, ISelectableItem pItem) { OnItemSelection(pLevel, pItem); IParentItem parItem = (pItem as IParentItem); if (parItem != null) { vHistory.Push(vCurrLevel); SetNewLevel(parItem.ChildGroup, 1); return; } if (pItem.NavigateBackUponSelect) { Back(); } }
public void Start(IParentItem parent) { Parent = parent; Parent.SetFocus (this); StartProgram (); }
public void Start(IParentItem parent) { Parent = parent; Parent.SetFocus(this); StartProgram(); }