Sparrow.Display.DisplayObject.InvokeAdded C# (CSharp) Méthode

InvokeAdded() private méthode

private InvokeAdded ( DisplayObject target, DisplayObject currentTarget ) : void
target DisplayObject
currentTarget DisplayObject
Résultat void
        internal virtual void InvokeAdded(DisplayObject target, DisplayObject currentTarget)
        {
            if (Added != null)
            {
                Added(target, currentTarget);
            }
        }

Usage Example

Exemple #1
0
        /// <summary>
        /// Adds a child to the container at a certain index.
        /// </summary>
        public void AddChild(DisplayObject child, int index)
        {
            if (index >= 0 && index <= _children.Count)
            {
                SetRequiresRedraw();

                if (child.Parent == this)
                {
                    SetChildIndex(child, index); // avoids dispatching events
                }
                else
                {
                    child.RemoveFromParent();
                    _children.Insert(index, child);
                    child.Parent = this;

                    child.InvokeAdded(child, this);
                    if (Stage != null)
                    {
                        child.BroadcastAddedToStageEvent(this);
                    }
                }
            }
            else
            {
                throw new IndexOutOfRangeException("Invalid child index " + index);
            }
        }
All Usage Examples Of Sparrow.Display.DisplayObject::InvokeAdded