Axiom.Core.Node.RemoveChild C# (CSharp) Method

RemoveChild() protected method

Internal method to remove a child of this node, keeping it in the list of child nodes by option. Useful when enumerating the list of children while removing them too.
protected RemoveChild ( Node child, bool removeFromInternalList ) : void
child Node
removeFromInternalList bool
return void
		protected virtual void RemoveChild( Node child, bool removeFromInternalList )
		{
			CancelUpdate( child );
			child.NotifyOfNewParent( null );

            if (removeFromInternalList)
            {
                childNodes.Remove(child.Name);
            }
		}

Same methods

Node::RemoveChild ( string name ) : Node
Node::RemoveChild ( Node child ) : void

Usage Example

Example #1
0
 protected virtual void ParentChanged(Node oldParent, Node newParent)
 {
     if(oldParent != null) {
         oldParent.RemoveChild(this);
         if (NodeDetachedEvent != null)
             NodeDetachedEvent(this);
     }
     if (newParent != null) {
         newParent.AddChild(this);
         if (NodeAttachedEvent != null)
             NodeAttachedEvent(this);
     }
 }