Exemple #1
0
        /// <summary>
        /// Adds the child.
        /// </summary>
        /// <param name="element">The element.</param>
        public virtual void AddChild(UPMElement element)
        {
            if (element != null)
            {
                element.Parent = this;
                this.Children.Add(element);
            }

            this.GUIContainer?.ChildrenAdded(element);
        }
Exemple #2
0
        /// <summary>
        /// Adds the child.
        /// </summary>
        /// <param name="element">The element.</param>
        public virtual void RemoveChild(UPMElement element)
        {
            if (element != null)
            {
                if (this.Children.Contains(element))
                {
                    this.Children.Remove(element);
                }
            }

            this.GUIContainer?.ChildrenRemoved(element);
        }
Exemple #3
0
        /// <summary>
        /// Inserts the index of the child at.
        /// </summary>
        /// <param name="element">The element.</param>
        /// <param name="index">The index.</param>
        public void InsertChildAtIndex(UPMElement element, int index)
        {
            if (element == null)
            {
                return;
            }

            this.Children?.Insert(index, element);

            // element.Parent = this;

            this.GUIContainer?.ChildrenAddedAtIndex(element, index);
        }
Exemple #4
0
 /// <summary>
 /// Indexes the of child.
 /// </summary>
 /// <param name="element">The element.</param>
 /// <returns></returns>
 public int IndexOfChild(UPMElement element) => this.Children?.IndexOf(element) ?? -1;