/// <summary> /// Adds another OverlayElement to this container. /// </summary> /// <param name="element"></param> public virtual void AddChildImpl(OverlayElement element) { Debug.Assert(!children.ContainsKey(element.Name), string.Format("Child with name '{0}' already defined.", element.Name)); // add to lookup table and list children.Add(element.Name, element); childList.Add(element); // inform this child about his/her parent and zorder element.NotifyParent(this, overlay); element.NotifyZOrder(zOrder + 1); }
/// <summary> /// Add a nested container to this container. /// </summary> /// <param name="container"></param> public virtual void AddChildImpl(OverlayElementContainer container) { // add this container to the main child list first OverlayElement element = container; AddChildImpl(element); element.NotifyParent(this, overlay); element.NotifyZOrder(zOrder + 1); // inform container children of the current overlay // *gasp* it's a foreach! this isn't a time critical method anyway foreach (OverlayElement child in container.children) { child.NotifyParent(container, overlay); child.NotifyZOrder(container.ZOrder + 1); } // now add the container to the container collection childContainers.Add(container.Name, container); }
/// <summary> /// Adds another OverlayElement to this container. /// </summary> /// <param name="element"></param> public virtual void AddChildElement( OverlayElement element ) { Debug.Assert( !this.children.ContainsKey( element.Name ), string.Format( "Child with name '{0}' already defined.", element.Name ) ); // add to lookup table and list this.children.Add( element.Name, element ); // inform this child about his/her parent and zorder element.NotifyParent( this, overlay ); element.NotifyZOrder( zOrder + 1 ); element.NotifyWorldTransforms( xform ); element.NotifyViewport(); }