Exemple #1
0
        /// <summary>
        /// Appends the child.
        /// </summary>
        /// <param name="child">The child.</param>
        /// <returns></returns>
        public ASTreeViewNode AppendChild(ASTreeViewNode child)
        {
            child.SetParent(this);
            this.childNodes.Add(child);

            return(this);
        }
Exemple #2
0
        /// <summary>
        /// Removes the specified node.
        /// </summary>
        /// <param name="node">The node.</param>
        /// <returns></returns>
        public ASTreeViewNode Remove(ASTreeViewNode node)
        {
            if (this.childNodes.Contains(node))
            {
                this.childNodes.Remove(node);
                node.SetParent(null);
            }

            return(this);
        }
Exemple #3
0
        /// <summary>
        /// Inserts the specified index.
        /// </summary>
        /// <param name="index">The index.</param>
        /// <param name="node">The node.</param>
        /// <returns></returns>
        public ASTreeViewNode Insert(int index, ASTreeViewNode node)
        {
            if (index > this.childNodes.Count)
            {
                this.AppendChild(node);
            }
            else
            {
                this.childNodes.Insert(index, node);
            }

            node.SetParent(this);

            return(this);
        }