private void CreateRecursiveTemplates(PanelHierarchyData panelHierarchy, PruningTree tree) { var panelHeaderTemplate = SelectHeaderTemplate(panelHierarchy); ((PanelHeaderTemplate)panelHeaderTemplate).PanelDiv = PanelDiv; CreateTemplateControl(panelHierarchy, panelHeaderTemplate); var panelTemplate = SelectPanelTemplate(panelHierarchy); CreateTemplateControl(panelHierarchy, panelTemplate); if (panelHierarchy.HasChildren) { var childIdx = 0; CreateTemplateControl(panelHierarchy, DescendTemplate); foreach (var childHierarchy in panelHierarchy.GetChildren()) { var childTree = tree.Children[childIdx++]; if (childTree.IsVisible) { CreateRecursiveTemplates((PanelHierarchyData)childHierarchy, childTree); } } CreateTemplateControl(panelHierarchy, AscendTemplate); } var panelFooterTemplate = SelectFooterTemplate(panelHierarchy); ((PanelFooterTemplate)panelFooterTemplate).PanelDiv = PanelDiv; CreateTemplateControl(panelHierarchy, panelFooterTemplate); }
private PruningTree CreatePruningInformation(IHierarchyData root) { PruningTree tree = new PruningTree(); if (root.HasChildren) { var anyVisible = ShowEmpty; foreach (var child in root.GetChildren()) { var childTree = CreatePruningInformation((IHierarchyData)child); anyVisible = anyVisible || childTree.IsVisible; tree.Children.Add(childTree); } tree.IsVisible = anyVisible; } else { var pc = (PanelContent)root.Item; tree.IsVisible = (ShowEmpty || pc.HasResult) && SelectPanelTemplate(root) != null; tree.IsVisible = tree.IsVisible && (SingletonValues || GetPanelTypeEnum(root) != PanelType.Values || pc.ResultAsValues().Size > 1); } return(tree); }