HtmlAgilityPack.HtmlNode.CopyFrom C# (CSharp) Метод

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

Creates a duplicate of the node.
public CopyFrom ( HtmlNode node, bool deep ) : void
node HtmlNode The node to duplicate. May not be null.
deep bool true to recursively clone the subtree under the specified node, false to clone only the node itself.
Результат void
		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));
					}
				}
			}
		}

Same methods

HtmlNode::CopyFrom ( HtmlNode node ) : void