Compartilhar via


ProjectElementContainer.RemoveChild(ProjectElement) Method

Definition

Removes the specified child. Throws if the child is not currently parented by this object. This is O(1). May be safely called during enumeration of the children.

public:
 void RemoveChild(Microsoft::Build::Construction::ProjectElement ^ child);
public void RemoveChild (Microsoft.Build.Construction.ProjectElement child);
member this.RemoveChild : Microsoft.Build.Construction.ProjectElement -> unit
Public Sub RemoveChild (child As ProjectElement)

Parameters

child
ProjectElement

The project element to be removed.

Remarks

This is actually safe to call during enumeration of children, because it doesn't bother to clear the child's NextSibling (or PreviousSibling) pointers. To determine whether a child is unattached, check whether its parent is null, or whether its NextSibling and PreviousSibling point back at it. DO NOT BREAK THIS VERY USEFUL SAFETY CONTRACT.

Applies to