private void addCategoryButton_Click(object sender, EventArgs e) { ScriptRepositoryCategory newCat = new ScriptRepositoryCategory("new category"); this.repository.Categories.Add(newCat); TreeNode tn = this.addCategoryToTreeView(newCat); this.scriptsTreeView.SelectedNode = tn; tn.BeginEdit(); }
public void TestInit() { repo = new ScriptRepository("testRepo"); repo.Scripts.Add(new ScriptManifestReference("test.scmanifest")); repo.Scripts.Add(new ScriptManifestReference("another_test.scmanifest")); ScriptRepositoryCategory cat = new ScriptRepositoryCategory("testCategory"); cat.Scripts.Add(new ScriptManifestReference("outliner.scmanifest")); repo.Categories.Add(cat); }
private TreeNode addCategoryToTreeView(ScriptRepositoryCategory cat) { TreeNode tn = new TreeNode(cat.Name); tn.ImageKey = tn.SelectedImageKey = "repository_category"; tn.Tag = cat; foreach (ScriptManifestReference s in cat.Scripts) { this.addScriptToTreeView(s, tn.Nodes); } this.scriptsTreeView.Nodes.Add(tn); return tn; }
public void CategoryConstructorTest() { ScriptRepositoryCategory cat = new ScriptRepositoryCategory(); Assert.IsNotNull(cat.Name); Assert.IsNotNull(cat.Scripts, "Scripts should not be null"); }