Beispiel #1
0
        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);
        }
Beispiel #2
0
        private void CreateTemplateControl(PanelHierarchyData panel, ITemplate template)
        {
            if (template == null)
            {
                return;
            }

            var container = CreatePanelTemplateContainer(panel);

            template.InstantiateIn(container);
            Controls.Add(container);
        }
Beispiel #3
0
        private void InitPanelSourceRoot()
        {
            PanelHierarchicalEnumerable enumerable = GetData(SubPath).Select() as PanelHierarchicalEnumerable;

            if (enumerable == null)
            {
                return;
            }

            var enumerator = enumerable.GetEnumerator();

            if (!enumerator.MoveNext())
            {
                return;
            }

            _root = enumerator.Current;
        }
 public PanelHierarchyData(PanelHierarchyData parentZone, PanelContent panelContent, int indent)
 {
     _indent       = indent;
     _parentZone   = parentZone;
     _panelContent = panelContent;
 }
Beispiel #5
0
 private PanelTemplateContainer CreatePanelTemplateContainer(PanelHierarchyData panel)
 {
     return(GetPanelType(panel).CreatePanelTemplateContainer(panel));
 }