Пример #1
0
        private void newProjectButton_Click(object sender, EventArgs e)
        {
            try
            {
                Project p = null;

                using (NewProjectForm dial = new NewProjectForm())
                {
                    if (dial.ShowDialog() == DialogResult.OK)
                    {
                        string projectName = dial.NewProjectName;
                        m_Parent.OnProjectOpening();
                        p = new ProjectDatabase().OpenProject(projectName);
                    }
                }

                if (p != null)
                {
                    DialogResult = DialogResult.OK;
                    Close();
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Пример #2
0
 private void FileNew(IUserAction action)
 {
     using (NewProjectForm dial = new NewProjectForm())
     {
         if (dial.ShowDialog() == DialogResult.OK)
         {
             string projectName = dial.NewProjectName;
             OnProjectOpening();
             Project p = new ProjectDatabase().OpenProject(projectName);
             AddRecentProject(projectName);
         }
     }
 }