Axiom.Overlays.OverlayElement.NotifyParent C# (CSharp) Method

NotifyParent() public method

Internal method for notifying the gui element of it's parent and ultimate overlay.
public NotifyParent ( OverlayElementContainer parent, Overlay overlay ) : void
parent OverlayElementContainer Parent of this element.
overlay Overlay Overlay this element belongs to.
return void
		public virtual void NotifyParent( OverlayElementContainer parent, Overlay overlay )
		{
			this.parent = parent;
			this.overlay = overlay;

			if ( overlay != null && overlay.IsInitialized && !this.isInitialized )
			{
				Initialize();
			}

			isDerivedOutOfDate = true;
		}

Usage Example

        /// <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);
        }
All Usage Examples Of Axiom.Overlays.OverlayElement::NotifyParent