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); }
public override bool Matches(DomNode node) { throw new NotImplementedException(); }
public override void WriteStartElement(DomName name) { _state.StartElement(); _current = _current.AppendElement(name); _attribute = null; }
private void InsertCore(int index, DomNode item) { throw Failure.ReadOnlyCollection(); }
internal override DomNode GetPreviousSibling(DomNode other) { return(null); }
public override bool Remove(DomNode item) { return(RemoveCore(item)); }
public override bool Contains(DomNode item) { return(false); }
private bool RemoveCore(DomNode node) { throw Failure.ReadOnlyCollection(); }
public ScopedDomObserverTarget(DomObserver observer, DomNode target, DomScope scope) : base(observer) { Target = target; Scope = scope; }
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); } }
public DomObserver ObserveAttributes(DomNode target, DomName attribute, Action <DomAttributeEvent> handler) { return(ObserveAttributes(target, attribute, handler, DomScope.Target)); }
private IEnumerable <IObserver <DomEvent> > GetObservers(DomObserverEventScope s, DomNode node) { return(_observers.GetObservers(node, s)); }
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); }
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)); }
internal abstract bool AppliesTo(DomNode node);
public override void Add(DomNode item) { InsertCore(Count, item); }
public DomNodeWriter CreateWriter(DomNode node, DomNodeWriterSettings settings) { return(CreateDomWriter(node)); }
public override void Insert(int index, DomNode item) { InsertCore(index, item); }
public DomNodeReader CreateReader(DomNode node) { return(CreateDomReader(node)); }
internal override DomNode GetNextSibling(DomNode other) { return(null); }
public override int IndexOf(DomNode node) { return(_items.IndexOf(node)); }
public override int IndexOf(DomNode node) { return(-1); }
public override void Add(DomNode item) { _items.Add(item); }
public override void WriteEndElement() { _state.EndElement(); _current = _current.ParentNode; }
public override bool Contains(DomNode item) { return(_items.Contains(item)); }
public override void WriteEndDocument() { _state.EndDocument(); _current = null; _attribute = null; }
internal override DomNode GetPreviousSibling(DomNode other) { return(_items.GetPreviousSibling(other)); }