Exemplo n.º 1
0
 private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (currentProject != null && currentPath != null)
     {
         if (saveFileDialog1.ShowDialog() == DialogResult.OK)
         {
             currentProject.toFile(saveFileDialog1.FileName);
             currentPath = saveFileDialog1.FileName;
         }
     }
     else if (currentPath == null && currentProject != null)
     {
         saveFileDialog1.FileName = currentProject.Name + ".smprj";
         if (saveFileDialog1.ShowDialog() == DialogResult.OK)
         {
             currentProject.toFile(saveFileDialog1.FileName);
             currentPath = saveFileDialog1.FileName;
         }
     }
     else if (currentProject == null)
     {
         Project       newProject = new Project("New Project", nodes);
         ProjectDialog dialog     = new ProjectDialog(newProject);
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             LoadProject(dialog.Project);
             saveFileDialog1.FileName = currentProject.Name + ".smprj";
             if (saveFileDialog1.ShowDialog() == DialogResult.OK)
             {
                 currentProject.toFile(saveFileDialog1.FileName);
                 currentPath = saveFileDialog1.FileName;
             }
         }
     }
 }
Exemplo n.º 2
0
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Project       newProject = new Project("New Project");
            ProjectDialog dialog     = new ProjectDialog(newProject);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                LoadProject(dialog.Project);
            }
        }