InsertAfter() публичный Метод

Inserts the specified node immediately after the specified reference node.
public InsertAfter ( HtmlNode newChild, HtmlNode refChild ) : HtmlNode
newChild HtmlNode The node to insert. May not be null.
refChild HtmlNode The node that is the reference node. The newNode is placed after the refNode.
Результат HtmlNode
Пример #1
0
		public static void RemoveChildKeepGrandChildren ( HtmlNode parent , HtmlNode oldChild )
		{
			if ( oldChild.ChildNodes != null )
			{
				HtmlNode previousSibling = oldChild.PreviousSibling;
				foreach ( HtmlNode newChild in oldChild.ChildNodes )
				{
					parent.InsertAfter ( newChild , previousSibling );
					previousSibling = newChild;  // Missing line in HtmlAgilityPack
				}
			}
			parent.RemoveChild ( oldChild );
		}