Tinkr2/4.2/AphelionCore/AphelionCore/Controls/Container.cs
/// <summary>
/// Adds a child control to the container
/// </summary>
/// <param name="child">New child to add</param>
Adds a child control to the container
Adds a child control to the container
public virtual void AddChild(IControl child)
      {
         if (_children == null)
         {
            _children = new IControl[1];
         }
         else
         {
            var tmp = new IControl[_children.Length + 1];
            Array.Copy(_children, tmp, _children.Length);
            _children = tmp;
         }
         child.Parent = this;
         child.UpdateOffsets();
         _children[_children.Length - 1] = child;
         if (_active == null && child.CanFocus)
         {
            _active = child;
            _active.Activate();
         }
         Render(child.ScreenBounds, true);
      }
public virtual void AddChild ( IControl child ) { if ( _children == null ) { _children = new IControl [ 1 ] ; } else { var tmp = new IControl [ _children . Length + 1 ] ; Array . Copy ( _children , tmp , _children . Length ) ; _children = tmp ; } child . Parent = this ; child . UpdateOffsets ( ) ; _children [ _children . Length - 1 ] = child ; if ( _active == null && child . CanFocus ) { _active = child ; _active . Activate ( ) ; } Render ( child . ScreenBounds , true ) ; }
Adds a child control to the container
Adds a child control to the container
// Update Array Size // Set control properties // Assign Value // Render
child
IControl
New child to add
New child to add