예제 #1
0
 void RemoveUnrelatedNodes(IModelObjectView modelObjectView, IModelMergedDifferenceStrategyIncludedNodePath nodePath)
 {
     for (int i = modelObjectView.NodeCount - 1; i >= 0; i--)
     {
         var modelNode = modelObjectView.GetNode(i);
         if (modelNode.Id() == nodePath.NodePath)
         {
             modelNode.Remove();
             break;
         }
     }
 }
예제 #2
0
        void RemoveStrategyUnrelatedNodes(IModelObjectView modelObjectView, IModelMergedDifferenceStrategy strategy)
        {
            var nodePaths = new HashSet <string>(GetIncludedNodePaths(modelObjectView, strategy).Select(path => path.NodePath));

            for (int i = modelObjectView.NodeCount - 1; i >= 0; i--)
            {
                var modelNode = modelObjectView.GetNode(i);
                var id        = modelNode.Id();
                if (!nodePaths.Contains(id))
                {
                    modelNode.Remove();
                }
            }
        }