AddObjectsToTree(CategoryNameMap map, TreeNodeCollection curNodes)
        {
            m_tvObjs.Sorted = true;

			if (map.IsEmpty)
				return;		// nothing to add

                // iterate over the map and add items to the tree
			CategoryNameMapIterator iter = map.ForwardIterator();
			while (iter.MoveNext()) {
				TreeNode tmpNode = new TreeNode(iter.Key);
                tmpNode.Tag = iter.Current;
                curNodes.Add(tmpNode);

					// recursively add sub-nodes (if any)
				Category curCat = (Category)iter.Current;
				AddObjectsToTree(curCat.SubCategories, tmpNode.Nodes);
            }
        }
Exemple #2
0
        AddObjectsToTree(CategoryNameMap map, TreeNodeCollection curNodes)
        {
            m_tvObjs.Sorted = true;

            if (map.IsEmpty)
            {
                return;                   // nothing to add
            }
            // iterate over the map and add items to the tree
            CategoryNameMapIterator iter = map.ForwardIterator();

            while (iter.MoveNext())
            {
                TreeNode tmpNode = new TreeNode(iter.Key);
                tmpNode.Tag = iter.Current;
                curNodes.Add(tmpNode);

                // recursively add sub-nodes (if any)
                Category curCat = (Category)iter.Current;
                AddObjectsToTree(curCat.SubCategories, tmpNode.Nodes);
            }
        }
Exemple #3
0
    private void AddObjectsToTree(CategoryNameMap map, TreeNodeCollection curNodes)
    {
        TvObjs.Sorted = true;
        if (map.IsEmpty)
        {
            return;
        }

        // iterate over the map and add items to the tree
        var iterator = map.ForwardIterator();

        while (iterator.MoveNext())
        {
            var tmpNode = new TreeNode(iterator.Key)
            {
                Tag = iterator.Current
            };
            curNodes.Add(tmpNode);

            // recursively add sub-nodes (if any)
            var curCat = (Category)iterator.Current;
            AddObjectsToTree(curCat !.SubCategories, tmpNode.Nodes);
        }
    }