private static Node CreateNode(ElementView elementView) { var element = elementView.Element; var labels = element.GetTags(); var categoryRefs = labels.Select(x => new CategoryRef { Ref = x }).ToList(); if (element.Parent != null) { categoryRefs.Insert(0, new CategoryRef { Ref = element.Parent.Id }); } categoryRefs.Reverse(); return(new Node { Id = element.Id, Group = element.IsContainer() ? "Expanded" : null, Label = element.Name, Description = string.IsNullOrEmpty(element.Description) ? null : element.Description, Reference = element.Url, Category = categoryRefs.Select(x => x.Ref).FirstOrDefault(), CategoryRefs = categoryRefs }); }
private async Task <ElementRender> GetElementRender(long tenantId, Guid elementTypeId, long elementId, long pageId) { IElementSettings elementSettings = await _elementServiceFactory.ReadElementSettingsAsync(tenantId, elementTypeId, elementId); object elementContent = await _elementServiceFactory.ReadElementContentAsync(tenantId, elementTypeId, elementId, pageId); if (elementSettings == null) { return new ElementRender { PartialViewName = "~/Views/Elements/NotFound.cshtml" } } ; ElementView elementView = new ElementView { Settings = elementSettings, Content = elementContent }; return(new ElementRender { PartialViewName = $"~/Views/Elements/{elementTypeId}.cshtml", ElementView = elementView }); }
//pw:change it to handlers public ElementView GetTaskList(int?bagId, string path) { if (!string.IsNullOrEmpty(path)) { bagId = FindCorrectRoot(bagId, path); } Domain.Element element = _taskRepository.GetStructure(bagId); ElementView st = _mapper.Map <Domain.Element, ElementView>(element); return(st); }
private static Category CreateCategory(ElementView elementView) { var element = elementView.Element; if (element.Parent == null) { return(null); } return(new Category { Id = element.Parent.Id, Label = element.Parent.Name }); }
protected override bool CheckCanDraw(ElementView elementView) { return(FilterText.IsNullOrEmpty()); }
protected virtual bool CheckCanDraw(ElementView elementView) { return(true); }
protected override bool CheckCanDraw(ElementView elementView) { return(base.CheckCanDraw(elementView) || elementView.Data.A.Contains(FilterText)); }