public ConceptViewData(LMP.Models.Concept concept, bool buildTree) : this(concept) { if (!buildTree) { return; } Children = new List <ConceptViewData>(); InitTree(concept, concept.Children); }
public ConceptViewData(LMP.Models.Concept concept, bool buildTree, Func <LMP.Models.Concept, bool> filterFirstLevelChildren) : this(concept) { if (!buildTree) { return; } Children = new List <ConceptViewData>(); InitTree(concept, filterFirstLevelChildren == null ? concept.Children : concept.Children.Where(filterFirstLevelChildren).ToList()); }
public ConceptViewData(LMP.Models.Concept concept) { Id = concept.Id; Name = concept.Name; ShortName = concept.Name.Length <= 20 ? concept.Name : $"{concept.Name.Substring(0, 20)}..."; Container = concept.Container; ParentId = concept.ParentId.GetValueOrDefault(); IsGroup = concept.IsGroup; Published = concept.Published; //Published = (concept.IsGroup && concept.Children.Any() && concept.Children.All(c => c.Published)) || (!concept.IsGroup && concept.Published); ReadOnly = concept.ReadOnly; HasData = !string.IsNullOrEmpty(Container); Prev = concept.PrevConcept; Next = concept.NextConcept; SubjectName = concept.Subject.Name; }