예제 #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);
            }
예제 #2
0
 public override bool Matches(DomNode node)
 {
     throw new NotImplementedException();
 }
예제 #3
0
 public override void WriteStartElement(DomName name)
 {
     _state.StartElement();
     _current   = _current.AppendElement(name);
     _attribute = null;
 }
예제 #4
0
 private void InsertCore(int index, DomNode item)
 {
     throw Failure.ReadOnlyCollection();
 }
예제 #5
0
 internal override DomNode GetPreviousSibling(DomNode other)
 {
     return(null);
 }
예제 #6
0
 public override bool Remove(DomNode item)
 {
     return(RemoveCore(item));
 }
예제 #7
0
 public override bool Contains(DomNode item)
 {
     return(false);
 }
예제 #8
0
 private bool RemoveCore(DomNode node)
 {
     throw Failure.ReadOnlyCollection();
 }
예제 #9
0
 public ScopedDomObserverTarget(DomObserver observer, DomNode target, DomScope scope) : base(observer)
 {
     Target = target;
     Scope  = scope;
 }
예제 #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);
            }
        }
예제 #11
0
 public DomObserver ObserveAttributes(DomNode target, DomName attribute, Action <DomAttributeEvent> handler)
 {
     return(ObserveAttributes(target, attribute, handler, DomScope.Target));
 }
예제 #12
0
 private IEnumerable <IObserver <DomEvent> > GetObservers(DomObserverEventScope s, DomNode node)
 {
     return(_observers.GetObservers(node, s));
 }
예제 #13
0
 public DomObserver ObserveChildNodes(DomNode target, Action <DomMutationEvent> handler)
 {
     return(ObserveChildNodes(target, handler, DomScope.Target));
 }
예제 #14
0
 internal override DomNode GetNextSibling(DomNode other)
 {
     return(other.next);
 }
예제 #15
0
 public override void Insert(int index, DomNode item)
 {
     _items.Insert(index, item);
 }
예제 #16
0
        public void RegisterObserver(DomObserver observer, DomNode target, DomScope scope, DomObserverEventScope events)
        {
            var list = GetItemsForScope(events);

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