Beispiel #1
0
        /// <summary>
        /// Create a leaf categories supplied in the demo code
        /// </summary>
        /// <param name="example">Demo 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);
        }
        /// <summary>
        /// Create a leaf categories supplied in the demo code
        /// </summary>
        /// <param name="example">Demo 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;
        }