Esempio n. 1
0
        private void newProjectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TreeNodeCollection hier = hierarchy.Nodes;

            if (hier.Count != 0)
            {
                DialogResult dialogResult = MessageBox.Show("There is already a project. Do you want to close it and create a new one?", "", MessageBoxButtons.YesNo);

                if (dialogResult == DialogResult.Yes)
                {
                    DialogResult dialogResult2 = MessageBox.Show("Do you want to save files?", "", MessageBoxButtons.YesNo);
                    if (dialogResult == DialogResult.Yes)
                    {
                        save_all();
                    }

                    hierarchy.Nodes.Clear();
                    tabControl1.TabPages.Clear();

                    Form_NP.create_project();
                    if (Properties.Settings.Default.flag_create_project == true)
                    {
                        Properties.Settings.Default.flag_create_project = false;

                        projectname = Properties.Settings.Default.ProjectName;
                        projdirect  = Properties.Settings.Default.ProjectDirect;

                        hierarchy.Nodes.Add(projectname, projectname);

                        SaveTree(hierarchy, projdirect + "\\" + projectname + ".spf");

                        bt_AddProc.Enabled = true;
                        Properties.Settings.Default.flag_create_project = false;
                    }
                }
            }
            else
            {
                Form_NP.create_project();

                if (Properties.Settings.Default.flag_create_project == true)
                {
                    Properties.Settings.Default.flag_create_project = false;

                    projectname = Properties.Settings.Default.ProjectName;
                    projdirect  = Properties.Settings.Default.ProjectDirect;

                    hierarchy.Nodes.Add(projectname, projectname);

                    SaveTree(hierarchy, projdirect + "\\" + projectname + ".spf");

                    bt_AddProc.Enabled = true;
                    Properties.Settings.Default.flag_create_project = false;
                }
            }
        }
Esempio n. 2
0
        public static void create_project()
        {
            newForm_NP = new Form_NP();

            newForm_NP.ShowDialog();
        }