/// <summary> /// Removes the specified child from the import tree. /// </summary> /// <param name="child">The ImportNode to be removed.</param> protected internal void RemoveChild(ImportNode child) { Debug.Assert(child.Parent == this); Debug.Assert(children.Contains(child)); children.Remove(child); child.Parent = null; child.Name = null; // Update our dirtiness: CommitPending = true; }
/// <summary> /// Adds the specified node as a child of this node in the import tree /// with a given name. The child can subsequently be retrieved /// via this name. /// </summary> /// <param name="child">The child node.</param> /// <param name="childName">The name of the child.</param> protected internal ImportNode AddChild(ImportNode child, String childName) { Debug.Assert(!children.Contains(child)); if (child.Parent != null && child.Parent != this) { child = (ImportNode)child.Clone(); } children.Add(child); child.Parent = this; child.Name = childName; // Update our dirtiness: child.CommitPending = true; return(child); }
/// <summary> /// Adds the specified node as a child of this node in the import tree. /// </summary> /// <param name="child">The child node.</param> protected internal void AddChild(ImportNode child) { AddChild(child, null); }