Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        private void CreateTemplateControl(PanelHierarchyData panel, ITemplate template)
        {
            if (template == null)
            {
                return;
            }

            var container = CreatePanelTemplateContainer(panel);

            template.InstantiateIn(container);
            Controls.Add(container);
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 5
0
 private PanelTemplateContainer CreatePanelTemplateContainer(PanelHierarchyData panel)
 {
     return(GetPanelType(panel).CreatePanelTemplateContainer(panel));
 }