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); }
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); } } }