/// <summary> /// /// </summary> private void InitialiseTreeView() { Categories categories = m_activeDoc.Settings.Categories; CategoryNameMapIterator catNameMapIter = categories.ForwardIterator(); while (catNameMapIter.MoveNext()) { Category tempCategory = catNameMapIter.Current as Category; TreeNode node = new TreeNode(tempCategory.Name); node.Tag = tempCategory; m_treeView.Nodes.Add(node); } }
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); } }