Пример #1
0
 public HtmlNode InsertAfter(HtmlNode newChild, HtmlNode refChild)
 {
     if (newChild == null)
     {
         throw new ArgumentNullException("newChild");
     }
     if (refChild == null)
     {
         return(PrependChild(newChild));
     }
     if (newChild != refChild)
     {
         int num = -1;
         if (_childnodes != null)
         {
             num = _childnodes[refChild];
         }
         if (num == -1)
         {
             throw new ArgumentException(HtmlDocument.HtmlExceptionRefNotChild);
         }
         if (_childnodes != null)
         {
             _childnodes.Insert(num + 1, newChild);
         }
         _ownerdocument.SetIdForNode(newChild, newChild.GetId());
         _outerchanged = true;
         _innerchanged = true;
     }
     return(newChild);
 }