Пример #1
0
        private void RenderChildren(HtmlTextWriter output, Item parent)
        {
            Assert.ArgumentNotNull(output, "output");
            Assert.ArgumentNotNull(parent, "parent");
            IDataView dataView = this.GetDataView();

            if (dataView != null)
            {
                string         filter = this.GetFilter();
                ItemCollection itemC  = dataView.GetChildren(parent, string.Empty, true, 0, 0, filter);
                if (itemC != null)
                {
                    foreach (Item item in itemC)
                    {
                        this.RenderNodeBegin(output, dataView, filter, item, false, false);
                        RenderNodeEnd(output);
                    }
                }
            }
        }
Пример #2
0
        private void RenderNode(HtmlTextWriter output, IDataView dataView, string filter, Item root, Item parent, Item folder)
        {
            Assert.ArgumentNotNull(output, "output");
            Assert.ArgumentNotNull(dataView, "dataView");
            Assert.ArgumentNotNull(filter, "filter");
            Assert.ArgumentNotNull(root, "root");
            Assert.ArgumentNotNull(parent, "parent");
            Assert.ArgumentNotNull(folder, "folder");
            bool isExpanded = (parent.ID == root.ID) || (parent.Axes.IsAncestorOf(folder) && (parent.ID != folder.ID));

            this.RenderNodeBegin(output, dataView, filter, parent, parent.ID == folder.ID, isExpanded);
            if (isExpanded)
            {
                ItemCollection itemC = dataView.GetChildren(parent, string.Empty, true, 0, 0, this.GetFilter());
                if (itemC != null)
                {
                    foreach (Item item in itemC)
                    {
                        this.RenderNode(output, dataView, filter, root, item, folder);
                    }
                }
            }
            RenderNodeEnd(output);
        }