Esempio n. 1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (this.DesignMode)
                return;

            this.listView1.SelectedIndexChanged += new EventHandler(listView1_SelectedIndexChanged);
            this.listView1.ItemChecked += new ItemCheckedEventHandler(listView1_ItemChecked);

            JsonFileHandler<ScriptRepository> h = new JsonFileHandler<ScriptRepository>();
            this.installedScripts = h.Read(installedScriptsFile);
            if (installedScripts == null)
            {
                MessageBox.Show("Error loading installed scripts xml:\n" + installedScriptsFile, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            /*
            foreach (ScriptManifestReference r in this.installedScripts.Scripts)
            {
                this.LoadManifest(r.URI);
            }
            */
        }
 public void ConstructorCreatesDefaultCategoryTest()
 {
     ScriptRepository repo = new ScriptRepository();
     Assert.IsNotNull(repo.DefaultCategory, "DefaultCategory should not be null");
     Assert.IsNotNull(repo.Scripts, "Scripts should not be null");
     Assert.IsNotNull(repo.Categories, "Categories should not be null");
     Assert.IsFalse(repo.Categories.Contains(repo.DefaultCategory), "Default category should not be in categories list");
 }
 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);
 }
Esempio n. 4
0
        public RepositoryForm(DevCenter devCenter, ScriptRepository repository)
        {
            InitializeComponent();

            if (repository == null)
                throw new ArgumentNullException("Repository argument cannot be null");

            this.repository = repository;

            this.scriptRepositoryBindingSource.Add(repository);

            this.fillScriptsTreeView();
        }
Esempio n. 5
0
 public ScriptCenterCore()
 {
     _installedScriptsRepository = new ScriptRepository("installed_scripts");
 }
Esempio n. 6
0
 private void writeRepository(IPath path, ScriptRepository repository)
 {
     JsonFileHandler<ScriptRepository> handler = new JsonFileHandler<ScriptRepository>();
     try
     {
     handler.Write(path, repository);
     }
     catch (Exception exc)
     {
     MessageBox.Show(exc.Message);
     }
 }
Esempio n. 7
0
        private void newRepositoryButton_Click(object sender, EventArgs e)
        {
            this.switchNewButtonImageText(sender, newRepositoryButton_Click);

            ScriptRepository r = new ScriptRepository("New Repository");
            TreeNode tn = addRepositoryToTree(r, String.Empty);
            tn.Expand();
            this.filesTree.SelectedNode = tn;
        }
Esempio n. 8
0
        private TreeNode addRepositoryToTree(ScriptRepository repo, String filePath)
        {
            TreeNode tn = new TreeNode(repo.Name);
            tn.ImageKey = tn.SelectedImageKey = "repository";
            tn.Tag = new TreeNodeData(repo, typeof(RepositoryForm));

            this.filesTree.Nodes.Add(tn);
            this.Files.Add(repo, filePath);

            repo.PropertyChanged += new PropertyChangedEventHandler(propertyChanged);
            return tn;
        }