ZForge.Controls.ExplorerBar.Expando.OnItemAdded C# (CSharp) Метод

OnItemAdded() защищенный Метод

Raises the ItemAdded event
protected OnItemAdded ( System.Windows.Forms.ControlEventArgs e ) : void
e System.Windows.Forms.ControlEventArgs A ControlEventArgs that contains the event data
Результат void
        protected virtual void OnItemAdded(ControlEventArgs e)
        {
            // add the expando to the ControlCollection if it hasn't already
            if (!this.Controls.Contains(e.Control))
            {
                this.Controls.Add(e.Control);
            }

            // check if the control is a TaskItem
            if (e.Control is TaskItem)
            {
                TaskItem item = (TaskItem) e.Control;

                // set anchor styles
                item.Anchor = (AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right);

                // tell the TaskItem who's its daddy...
                item.Expando = this;
                item.SystemSettings = this.systemSettings;
            }

            // update the layout of the controls
            this.DoLayout();

            //
            if (ItemAdded != null)
            {
                ItemAdded(this, e);
            }
        }