internal void OnDocumentNodeRemoved(IXamlSubscription sender, DocumentNode oldNode, DocumentNodePath watchedRoot)
 {
     if (this.PathNodeRemoved == null)
     {
         return;
     }
     this.PathNodeRemoved(sender, oldNode, watchedRoot);
 }
 internal void OnDocumentNodeAdded(IXamlSubscription sender, DocumentNode newNode, DocumentNodePath watchedRoot)
 {
     if (this.PathNodeInserted == null)
     {
         return;
     }
     this.PathNodeInserted(sender, newNode, watchedRoot);
 }
Exemple #3
0
 private void Subscription_PathNodeInserted(IXamlSubscription sender, DocumentNode newNode, DocumentNodePath watchedRoot)
 {
     if (!(newNode.TargetType == typeof(DictionaryEntry)))
     {
         return;
     }
     this.newNodesAsync.Add(newNode);
     this.EnsureAsyncUpdate(SelectedElementsResourceObserver.UpdateState.Incremental);
 }
 private bool Unregister(XamlDocument document, DocumentNode node)
 {
     if (document != null)
     {
         IXamlSubscription watcher = this.GetWatcher(document);
         bool flag = watcher.Unregister(node);
         if (watcher.IsEmpty)
         {
             watcher.Update();
             watcher.Dispose();
             this.watchers.Remove(document);
         }
         else if (flag && !this.chainUpdate.Contains(document))
         {
             this.chainUpdate.Enqueue(document);
         }
     }
     return(true);
 }