FairyGUI.DisplayObject.InternalSetParent C# (CSharp) Method

InternalSetParent() private method

private InternalSetParent ( Container value ) : void
value Container
return void
        internal void InternalSetParent(Container value)
        {
            if (parent != value)
            {
                if (value == null && parent._disposed)
                    parent = value;
                else
                {
                    parent = value;
                    UpdateHierarchy();
                }
            }
        }

Usage Example

示例#1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="index"></param>
        /// <param name="dispose"></param>
        /// <returns></returns>
        public DisplayObject RemoveChildAt(int index, bool dispose)
        {
            if (index >= 0 && index < _children.Count)
            {
                DisplayObject child = _children[index];

                if (stage != null && !child._disposed)
                {
                    if (child is Container)
                    {
                        child.BroadcastEvent("onRemovedFromStage", null);
                    }
                    else
                    {
                        child.DispatchEvent("onRemovedFromStage", null);
                    }
                }
                _children.Remove(child);
                InvalidateBatchingState(true);
                if (!dispose)
                {
                    child.InternalSetParent(null);
                }
                else
                {
                    child.Dispose();
                }

                return(child);
            }
            else
            {
                throw new Exception("Invalid child index");
            }
        }
All Usage Examples Of FairyGUI.DisplayObject::InternalSetParent