示例#1
0
        public static NodeContent GetAllNodes(this IPublishedContent value)
        {
            var nodeContent = NodeContent.ToNodeContent(value);

            nodeContent.Properties.AddRange(value.Properties.Select(NodeProperty.ToNodeProperty));
            BuildNodes(value, nodeContent);
            return(nodeContent);
        }
示例#2
0
        private static void BuildNodes(IPublishedContent node, NodeContent nodeContent)
        {
            foreach (var child in node.Children)
            {
                var ncChild = NodeContent.ToNodeContent(child);
                ncChild.Properties.AddRange(child.Properties.Select(NodeProperty.ToNodeProperty));
                nodeContent.Children.Add(ncChild);

                if (child.Children.Any())
                {
                    BuildNodes(child, ncChild);
                }
            }
        }