예제 #1
0
            public override void LoadNextLevel(TreeNodeCat parent)
            {
                TreeNodeAppConfig ta = (TreeNodeAppConfig)parent;

                foreach (ConfigCategory cat in ta._list.Categories)
                {
                    TreeNodeCategory tc = new TreeNodeCategory(cat, parent.IsDataOnly);
                    parent.Nodes.Add(tc);
                }
            }
예제 #2
0
 private void toolStripButtonAddCat_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < treeView1.Nodes.Count; i++)
     {
         TreeNodeAppConfig ta = treeView1.Nodes[i] as TreeNodeAppConfig;
         if (ta != null)
         {
             ta.AddCategory();
             break;
         }
     }
 }
예제 #3
0
        public void LoadData(CategoryList list)
        {
            if (list == null)
            {
                Ret = new CategoryList();
            }
            else
            {
                Ret = list;
            }
            TreeNodeAppConfig ta = new TreeNodeAppConfig(Ret, _isDataOnly);

            treeView1.Nodes.Add(ta);
        }
예제 #4
0
        private void toolStripButtonOK_Click(object sender, EventArgs e)
        {
            Ret = new CategoryList();
            TreeNodeAppConfig ta = null;

            for (int i = 0; i < treeView1.Nodes.Count; i++)
            {
                ta = treeView1.Nodes[i] as TreeNodeAppConfig;
                if (ta != null)
                {
                    break;
                }
            }
            if (ta != null)
            {
                for (int i = 0; i < ta.Nodes.Count; i++)
                {
                    TreeNodeCategory tc = ta.Nodes[i] as TreeNodeCategory;
                    if (tc != null)
                    {
                        ConfigCategory cat = tc.Category;
                        cat.Properties.Properties.Clear();
                        Ret.Categories.Add(cat);
                        for (int j = 0; j < tc.Nodes.Count; j++)
                        {
                            TreeNodeConfigProperty tp = tc.Nodes[j] as TreeNodeConfigProperty;
                            if (tp != null)
                            {
                                cat.Properties.Properties.Add(tp.Property);
                            }
                        }
                    }
                }
            }
            this.DialogResult = DialogResult.OK;
        }