protected virtual void VisitDocument(DomDocument document) { if (document == null) { throw new ArgumentNullException(nameof(document)); } DefaultVisit(document); }
internal void PopRecord(DomDocument document, DomContainer target) { if (_previous == null) { return; } document.ChildNodesChanged(_mutation, target, Nodes.ToArray(), _previous, _next); }
private DomNode[] Parse(string markup) { // TODO Depends on provider factory var doc = new DomDocument(); var frag = doc.CreateDocumentFragment(); frag.LoadXml(markup); return(frag.ChildNodes.ToArray()); }
public ElementsByAttributeIndex(DomDocument owner, DomName name, Func <string, TKey> func, IEqualityComparer <TKey> comparer) : base(comparer) { _attributeName = name; _func = func; _observer = DomObserver.Compose( owner.ObserveAttributes(name, Handler), owner.ObserveChildNodes(Handler) ); foreach (var desc in owner.DescendantsAndSelf) { Add(desc.Attribute(_attributeName), desc); } }
protected virtual void WriteDocument(DomDocument document) { if (document == null) { throw new ArgumentNullException(nameof(document)); } // Don't generate an empty document if (document.ChildNodes.Count == 0) { return; } WriteStartDocument(); Visit(document.ChildNodes); WriteEndDocument(); }
void IDomNodeVisitor.Visit(DomDocument document) { VisitDocument(document); }
public DomUnlinkedNodeCollection(DomDocument domDocument) { _ownerDocument = domDocument; }
public ElementsByTokenAttributeIndex(DomDocument owner, DomName name, Func <string, TKey> func, IEqualityComparer <TKey> comparer) : base(owner, name, func, comparer) { }
void IDomNodeVisitor.Visit(DomDocument document) { WriteDocument(document); }