UMD.HCIL.Piccolo.PNode.RemoveChildren C# (CSharp) Method

RemoveChildren() protected method

Remove all the children in the given collection from this node’s list of children.
This method allows you to pass in any ICollection, rather than a PNodeList. This can be useful if you are using an ArrayList or some other collection type to store PNodes. Note, however, that this list still must contain only objects that extend PNode otherwise you will get a runtime error. To protect against problems of this type, use the RemoveChildren(PNodeList) method instead.

All removed nodes will have their parent set to null.

protected RemoveChildren ( ICollection childrenNodes ) : void
childrenNodes ICollection /// The collection of children to remove. ///
return void
		protected virtual void RemoveChildren(ICollection childrenNodes) {
			foreach (PNode each in childrenNodes) {
				RemoveChild(each);
			}
		}

Same methods

PNode::RemoveChildren ( UMD.HCIL.Piccolo.Util.PNodeList childrenNodes ) : void

Usage Example

		/// <summary>
		/// Removes bounds handles from the given node.
		/// </summary>
		/// <param name="aNode">The node to remove the bounds handles from.</param>
		public static void RemoveBoundsHandlesFrom(PNode aNode) {
			PNodeList handles = new PNodeList();
			PNodeList children = aNode.ChildrenReference;
			foreach (PNode each in children) {
				if (each is PBoundsHandle) {
					handles.Add(each);
				}
			}
			aNode.RemoveChildren(handles);
		}