public FilterTagsTreeNode(FilterTagsTreeNode InParent, FAllocationTagHierarchy.INode InAllocTagNode) { Parent = InParent; if (Parent != null) { Parent.Children.Add(this); } AllocTagNode = InAllocTagNode; }
private bool BuildInternalTree(string[] InFilterTerms, FAllocationTagHierarchy.INode InParentAllocTagNode, FilterTagsTreeNode InParentInternalNode) { bool bIsFiltering = InFilterTerms != null && InFilterTerms.Length > 0; foreach (var ChildAllocTagNode in InParentAllocTagNode.GetChildNodes()) { var ChildInternalNode = new FilterTagsTreeNode(null, ChildAllocTagNode); // Don't set the parent yet as we might not add it to the tree if (BuildInternalTree(InFilterTerms, ChildAllocTagNode, ChildInternalNode)) { // Link the node now ChildInternalNode.Parent = InParentInternalNode; InParentInternalNode.Children.Add(ChildInternalNode); } } foreach (var ChildAllocTag in InParentAllocTagNode.GetChildTags()) { var AllocTag = ChildAllocTag.GetTag().Value; bool bChildTagNamePassesFilter = true; if (bIsFiltering) { var FullTagName = AllocTag.Name.ToLower(); foreach (var FilterTerm in InFilterTerms) { if (!FullTagName.Contains(FilterTerm)) { bChildTagNamePassesFilter = false; break; } } } if (bChildTagNamePassesFilter) { var ChildInternalNode = new FilterTagsTreeNode(InParentInternalNode, ChildAllocTag); } } return(InParentInternalNode.Children.Count > 0); }
public FilterTagsTreeNode(FAllocationTagHierarchy.INode InAllocTagNode) { AllocTagNode = InAllocTagNode; }