Exemple #1
0
            internal override bool AppliesTo(DomNode node)
            {
                if (Disposed)
                {
                    return(false);
                }

                if (Target == node)
                {
                    return(true);
                }

                if (Scope == DomScope.TargetAndDescendants)
                {
                    return(node.AncestorNodes.Any(n => n == Target));
                }

                if (Scope == DomScope.TargetAndAncestors)
                {
                    return(Target.AncestorNodes.Any(n => n == node));
                }

                return(false);
            }
Exemple #2
0
 public override bool Matches(DomNode node)
 {
     throw new NotImplementedException();
 }
Exemple #3
0
 public override void WriteStartElement(DomName name)
 {
     _state.StartElement();
     _current   = _current.AppendElement(name);
     _attribute = null;
 }
Exemple #4
0
 private void InsertCore(int index, DomNode item)
 {
     throw Failure.ReadOnlyCollection();
 }
Exemple #5
0
 internal override DomNode GetPreviousSibling(DomNode other)
 {
     return(null);
 }
Exemple #6
0
 public override bool Remove(DomNode item)
 {
     return(RemoveCore(item));
 }
Exemple #7
0
 public override bool Contains(DomNode item)
 {
     return(false);
 }
Exemple #8
0
 private bool RemoveCore(DomNode node)
 {
     throw Failure.ReadOnlyCollection();
 }
Exemple #9
0
 public ScopedDomObserverTarget(DomObserver observer, DomNode target, DomScope scope) : base(observer)
 {
     Target = target;
     Scope  = scope;
 }
Exemple #10
0
        internal void ChildNodesChanged(DomMutation mutation, DomNode target, DomNode[] nodes, DomNode prev, DomNode next)
        {
            DomEvent evt = null;

            foreach (var o in GetObservers(DomObserverEventScope.ChildNodes, target))
            {
                if (evt == null)
                {
                    evt = DomMutationEvent.Create(mutation, target, nodes, prev, next);
                }
                o.OnNext(evt);
            }
        }
Exemple #11
0
 public DomObserver ObserveAttributes(DomNode target, DomName attribute, Action <DomAttributeEvent> handler)
 {
     return(ObserveAttributes(target, attribute, handler, DomScope.Target));
 }
Exemple #12
0
 private IEnumerable <IObserver <DomEvent> > GetObservers(DomObserverEventScope s, DomNode node)
 {
     return(_observers.GetObservers(node, s));
 }
Exemple #13
0
 public DomObserver ObserveChildNodes(DomNode target, Action <DomMutationEvent> handler)
 {
     return(ObserveChildNodes(target, handler, DomScope.Target));
 }
 internal override DomNode GetNextSibling(DomNode other)
 {
     return(other.next);
 }
 public override void Insert(int index, DomNode item)
 {
     _items.Insert(index, item);
 }
Exemple #16
0
        public void RegisterObserver(DomObserver observer, DomNode target, DomScope scope, DomObserverEventScope events)
        {
            var list = GetItemsForScope(events);

            list.Add(new ScopedDomObserverTarget(observer, target, scope));
        }
 public override bool Remove(DomNode item)
 {
     return(_items.Remove(item));
 }
Exemple #18
0
 internal abstract bool AppliesTo(DomNode node);
Exemple #19
0
 public override void Add(DomNode item)
 {
     InsertCore(Count, item);
 }
 public DomNodeWriter CreateWriter(DomNode node, DomNodeWriterSettings settings)
 {
     return(CreateDomWriter(node));
 }
Exemple #21
0
 public override void Insert(int index, DomNode item)
 {
     InsertCore(index, item);
 }
 public DomNodeReader CreateReader(DomNode node)
 {
     return(CreateDomReader(node));
 }
Exemple #23
0
 internal override DomNode GetNextSibling(DomNode other)
 {
     return(null);
 }
 public override int IndexOf(DomNode node)
 {
     return(_items.IndexOf(node));
 }
Exemple #25
0
 public override int IndexOf(DomNode node)
 {
     return(-1);
 }
 public override void Add(DomNode item)
 {
     _items.Add(item);
 }
Exemple #27
0
 public override void WriteEndElement()
 {
     _state.EndElement();
     _current = _current.ParentNode;
 }
 public override bool Contains(DomNode item)
 {
     return(_items.Contains(item));
 }
Exemple #29
0
 public override void WriteEndDocument()
 {
     _state.EndDocument();
     _current   = null;
     _attribute = null;
 }
 internal override DomNode GetPreviousSibling(DomNode other)
 {
     return(_items.GetPreviousSibling(other));
 }