private SetParent ( |
||
parentNode | ||
Résultat | void |
public virtual bool RemoveChild(DomNode childNode) { switch (childNode.NodeKind) { case HtmlNodeKind.Attribute: { //TODO: support remove attribute return(false); } default: { if (_myChildrenNodes != null) { bool result = _myChildrenNodes.Remove(childNode); if (result) { childNode.SetParent(null); NotifyChange(ElementChangeKind.RemoveChild, null); } return(result); } return(false); } } }
public virtual void AddChild(DomNode childNode) { #if DEBUG if (childNode.ParentNode != null) { throw new System.NotSupportedException(); } #endif switch (childNode.NodeKind) { case HtmlNodeKind.Attribute: { SetAttribute((DomAttribute)childNode); } break; default: { if (_myChildrenNodes == null) { _myChildrenNodes = new List <DomNode>(); } _myChildrenNodes.Add((DomNode)childNode); childNode.SetParent(this); NotifyChange(ElementChangeKind.AddChild, null); } break; } }
public virtual void AddChild(DomNode childNode) { switch (childNode.NodeType) { case HtmlNodeType.Attribute: { AddAttribute((DomAttribute)childNode); } break; default: { if (myChildrenNodes == null) { myChildrenNodes = new List <DomNode>(); } myChildrenNodes.Add((DomNode)childNode); childNode.SetParent(this); NotifyChange(ElementChangeKind.AddChild); } break; } }
public virtual bool RemoveChild(DomNode childNode) { switch (childNode.NodeType) { case HtmlNodeType.Attribute: { //TODO: support remove attribute return false; } default: { if (myChildrenNodes != null) { bool result = myChildrenNodes.Remove(childNode); if (result) { childNode.SetParent(null); NotifyChange(ElementChangeKind.RemoveChild); } return result; } return false; } } }
public virtual void AddChild(DomNode childNode) { switch (childNode.NodeType) { case HtmlNodeType.Attribute: { AddAttribute((DomAttribute)childNode); } break; default: { if (myChildrenNodes == null) { myChildrenNodes = new List<DomNode>(); } myChildrenNodes.Add((DomNode)childNode); childNode.SetParent(this); NotifyChange(ElementChangeKind.AddChild); } break; } }