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); } }
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; } } }
public void LoadData(CategoryList list) { if (list == null) { Ret = new CategoryList(); } else { Ret = list; } TreeNodeAppConfig ta = new TreeNodeAppConfig(Ret, _isDataOnly); treeView1.Nodes.Add(ta); }
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; }