Example #1
0
        protected virtual void VisitDocument(DomDocument document)
        {
            if (document == null)
            {
                throw new ArgumentNullException(nameof(document));
            }

            DefaultVisit(document);
        }
Example #2
0
                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);
                }
            }
Example #5
0
        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();
        }
Example #6
0
 void IDomNodeVisitor.Visit(DomDocument document)
 {
     VisitDocument(document);
 }
Example #7
0
 public DomUnlinkedNodeCollection(DomDocument domDocument)
 {
     _ownerDocument = domDocument;
 }
Example #8
0
 public ElementsByTokenAttributeIndex(DomDocument owner, DomName name, Func <string, TKey> func, IEqualityComparer <TKey> comparer) : base(owner, name, func, comparer)
 {
 }
Example #9
0
 void IDomNodeVisitor.Visit(DomDocument document)
 {
     WriteDocument(document);
 }