コード例 #1
0
 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();
 }
コード例 #2
0
 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);
 }
コード例 #3
0
        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;
        }
コード例 #4
0
 public void CategoryConstructorTest()
 {
     ScriptRepositoryCategory cat = new ScriptRepositoryCategory();
     Assert.IsNotNull(cat.Name);
     Assert.IsNotNull(cat.Scripts, "Scripts should not be null");
 }