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

RemoveChild() public method

Removes the child node with the specified name.
public RemoveChild ( string name ) : Node
name string Name of the child node
return Node
		public virtual Node RemoveChild( string name )
		{
			Node child;
			if ( !childNodes.TryGetValue( name, out child ) )
				throw new AxiomException( "Node named '{0}' not found.", name );

			RemoveChild( child );

			return child;
		}

Same methods

Node::RemoveChild ( Node child ) : void
Node::RemoveChild ( Node child, bool removeFromInternalList ) : 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);
     }
 }