Example #1
0
        public void LoadProjectClasses(MOG_Project proj)
        {
            this.tvClasses.Nodes.Clear();

            foreach (string rootClassName in proj.GetRootClassificationNames())
            {
                imTreeNode rootNode = LoadProjectClasses_Helper(proj, rootClassName);
                this.tvClasses.Nodes.Add(rootNode);
                rootNode.Expand();
            }
        }
Example #2
0
        private ArrayList BuildClassificationTree(MOG_Project proj)
        {
            ArrayList nodeList = new ArrayList();

            foreach (string rootName in proj.GetRootClassificationNames())
            {
                classTreeNode rootNode = BuildClassificationTree_Helper(rootName, proj);
                nodeList.Add(rootNode);
            }

            return(nodeList);
        }
Example #3
0
        public void LoadProjectClassifications2(MOG_Project proj)
        {
            if (proj != null)
            {
                this.tvClassifications.Nodes.Clear();
                this.newClasses.Clear();

                this.imageList      = new ImageList();
                this.imageArrayList = new ArrayList();

                this.tvClassifications.Enabled = true;


                foreach (string rootClassName in proj.GetRootClassificationNames())
                {
                    classTreeNode rootClassNode = new classTreeNode(rootClassName);
                    if (proj.GetSubClassificationNames(rootClassName).Count > 0)
                    {
                        rootClassNode.Nodes.Add(new classTreeNode("DUMMY_NODE"));
                    }

                    this.tvClassifications.Nodes.Add(rootClassNode);
                }

                // setup events
                this.tvClassifications.MouseDown    -= new MouseEventHandler(tvClassifications_MouseDown);
                this.tvClassifications.MouseDown    += new MouseEventHandler(tvClassifications_MouseDown2);
                this.tvClassifications.AfterSelect  += new TreeViewEventHandler(tvClassifications_AfterSelect2);
                this.tvClassifications.BeforeExpand += new TreeViewCancelEventHandler(tvClassifications_BeforeExpand);

                // expand the first level of nodes
                foreach (TreeNode tn in this.tvClassifications.Nodes)
                {
                    tn.Expand();
                }
            }
            else
            {
                // disable everything
                this.tvClassifications.Nodes.Add(new classTreeNode("<NO CURRENT PROJECT>"));
                this.tvClassifications.Enabled = false;
            }
        }