Ejemplo n.º 1
0
            private void Visit(DocumentNodePath basisPath, DocumentNodePath rootPath, DocumentNode current, XamlProjectSubscription.XamlDocumentSubscription.NodeChangeCallback callback)
            {
                foreach (DocumentNode newNode in this.searchPath(current))
                {
                    callback(basisPath, newNode);
                }
                if (!current.Type.IsExpression || current.Parent == null || !current.IsProperty)
                {
                    return;
                }
                DocumentNode documentNode = new ExpressionEvaluator((IDocumentRootResolver)this.ProjectSubscription.ProjectContext).EvaluateExpression(basisPath, current);

                if (documentNode == null || documentNode == current)
                {
                    return;
                }
                if (documentNode.DocumentRoot != this.DocumentRoot)
                {
                    callback(basisPath, current);
                }
                else
                {
                    DocumentNodePath pathInSubContainer = rootPath.GetPathInContainer(current).GetPathInSubContainer(current.SitePropertyKey, documentNode);
                    this.WalkDescendants(basisPath, pathInSubContainer, documentNode, callback);
                }
            }
Ejemplo n.º 2
0
 private void WalkDescendants(DocumentNodePath basisPath, DocumentNodePath rootPath, DocumentNode currentNode, XamlProjectSubscription.XamlDocumentSubscription.NodeChangeCallback callback)
 {
     this.Visit(basisPath, rootPath, currentNode, callback);
     foreach (DocumentNode current in currentNode.DescendantNodes)
     {
         this.Visit(basisPath, rootPath, current, callback);
     }
 }