/// <summary>
        ///     Adds a new category to the list.
        /// </summary>
        /// <param name="categoryName">Name of the category.</param>
        /// <returns>Newly created control.</returns>
        public virtual CollapsibleCategory Add(string categoryName)
        {
            var cat = new CollapsibleCategory(this);

            cat.Text = categoryName;
            Add(cat);

            return(cat);
        }
        /// <summary>
        ///     Adds a category to the list.
        /// </summary>
        /// <param name="category">Category control to add.</param>
        protected virtual void Add(CollapsibleCategory category)
        {
            category.Parent     = this;
            category.Dock       = Pos.Top;
            category.Margin     = new Margin(1, 0, 1, 1);
            category.Selected  += OnCategorySelected;
            category.Collapsed += OnCategoryCollapsed;

            // this relies on fact that category.m_List is set to its parent
        }