Example #1
0
        //------------------------------------------------------------------------
        public static Project CreateProject(string name, SymInst parent)
        {
            Project prj = new Project();

            prj.Name      = name;
            prj.Local     = false;
            prj.ParentSym = parent;
            parent.ProjectAdd(prj);
            return(prj);
        }
Example #2
0
        //========================================================================
        private void btnOkay_Click(object sender, EventArgs e)
        {
            //first load existing projects
            //(this was a bug, where Importing to a not-previously-connected Sym would just overwrite the existing projects file)
            inst.ProjectsLoad();

            for (int i = 0; i < lstProjects.Items.Count; i++)
            {
                if (lstProjects.Items[i].Checked)
                {
                    inst.ProjectAdd(prjs[i]);
                }
            }
            try
            {
                inst.ProjectsSave();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Re-Saving Projects File After Import\nError: " + ex.Message, "PwrIDE", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            Util.MainForm.Explorer.ProjectsImported(inst);
            DialogResult = DialogResult.OK;
        }