Container for category as a tree node leaf
Inheritance: System.Windows.Forms.TreeNode, IHtmlWriter
Ejemplo n.º 1
0
        /// <summary>
        /// Create a leaf categories supplied in the example code
        /// </summary>
        /// <param name="example">Example to create </param>
        /// <returns>Categorynode</returns>
        private CategoryTreeNode LeafCategory(ExampleCode example)
        {
            var categories            = example.Category.Split('/');
            CategoryTreeNode previous = null;

            foreach (var categ in categories)
            {
                CategoryTreeNode categNode;
                if (!mCategories.TryGetValue(categ, out categNode))
                {
                    categNode = new CategoryTreeNode(categ);
                    if (previous == null)
                    {
                        this.Nodes.Add(categNode);
                    }
                    else
                    {
                        previous.Nodes.Add(categNode);
                    }

                    mCategories.Add(categ, categNode);
                }

                previous = categNode;
            }

            return(previous);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create a leaf categories supplied in the example code
        /// </summary>
        /// <param name="example">Example to create </param>
        /// <returns>Categorynode</returns>
        private CategoryTreeNode LeafCategory(ExampleCode example)
        {
            var categories = example.Category.Split('/');
            CategoryTreeNode previous = null;
            foreach (var categ in categories) {
                CategoryTreeNode categNode;
                if (!mCategories.TryGetValue(categ, out categNode)) {
                    categNode = new CategoryTreeNode(categ);
                    if (previous == null)
                        this.Nodes.Add(categNode);
                    else
                        previous.Nodes.Add(categNode);

                    mCategories.Add(categ, categNode);
                }

                previous = categNode;
            }

            return previous;
        }