Esempio n. 1
0
        private Node GetNodeCopy(string name, Node original, bool deepCopy, BindMode bindMode)
        {
            var newNode = new Node(name, original.Data);

            NodeBinder.Bind(original, newNode, bindMode);

            if (!deepCopy)
            {
                return(newNode);
            }

            CopyNodeChildrenRec(original, newNode, bindMode);

            return(newNode);
        }
Esempio n. 2
0
        private void CopyNodeChildrenRec(Node from, Node to, BindMode bindMode)
        {
            var newChildren = new List <Node>();

            foreach (var child in from.Children)
            {
                var newChild = new Node(child.Name, child.Data);
                NodeBinder.Bind(child, newChild, bindMode);

                newChildren.Add(newChild);

                CopyNodeChildrenRec(child, newChild, bindMode);
            }

            to.CommitChildren(newChildren, null);
        }