diff options
Diffstat (limited to 'tools/Sandcastle/Source/BuildAssembler/BuildComponents/CloneComponent.cs')
-rw-r--r-- | tools/Sandcastle/Source/BuildAssembler/BuildComponents/CloneComponent.cs | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tools/Sandcastle/Source/BuildAssembler/BuildComponents/CloneComponent.cs b/tools/Sandcastle/Source/BuildAssembler/BuildComponents/CloneComponent.cs new file mode 100644 index 0000000..d22ccf5 --- /dev/null +++ b/tools/Sandcastle/Source/BuildAssembler/BuildComponents/CloneComponent.cs @@ -0,0 +1,44 @@ +// Copyright © Microsoft Corporation. +// This source file is subject to the Microsoft Permissive License. +// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx. +// All other rights reserved. + +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Xml; +using System.Xml.XPath; +using System.Xml.Xsl; + +using System.Reflection; + +namespace Microsoft.Ddue.Tools { + + public class CloneComponent : BuildComponent { + + private List<IEnumerable<BuildComponent>> branches = new List<IEnumerable<BuildComponent>>(); + + public CloneComponent (BuildAssembler assembler, XPathNavigator configuration) : base(assembler, configuration) { + + XPathNodeIterator branch_nodes = configuration.Select("branch"); + foreach (XPathNavigator branch_node in branch_nodes) { + BuildComponent[] branch = BuildAssembler.LoadComponents(branch_node); + branches.Add(branch); + } + + } + + public override void Apply (XmlDocument document, string key) { + + foreach (IEnumerable<BuildComponent> branch in branches) { + XmlDocument subdocument = document.Clone() as XmlDocument; + foreach(BuildComponent component in branch) { + component.Apply(subdocument, key); + } + } + + } + + } + +}
\ No newline at end of file |