public void CopyFrom(HtmlNode node, bool deep)
{
if (node == null)
{
throw new ArgumentNullException("node");
}
Attributes.RemoveAll();
if (node.HasAttributes)
{
foreach(HtmlAttribute att in node.Attributes)
{
SetAttributeValue(att.Name, att.Value);
}
}
if (!deep)
{
RemoveAllChildren();
if (node.HasChildNodes)
{
foreach(HtmlNode child in node.ChildNodes)
{
AppendChild(child.CloneNode(true));
}
}
}
}