public void AddNewSession() { WizardNew theWizardNew; theWizardNew = new WizardNew(WizardNew.StartPage.session); theWizardNew.ShowDialog(this); if (theWizardNew.has_created_session) { _Project.AddSession (theWizardNew.GetSession()); Notify(this, new UpdateAll()); UpdateUIControls (); } }
private void ActionNew() { bool hasUserCancelledOperation = false; WizardNew wizard; // If unsaved changes exist for the project and/or sessions, ask the user // whether to save them. if (_Project.AreProjectOrSessionsChanged()) { // The user decides whether or what to save. _Project.Save(true); hasUserCancelledOperation = _Project.HasUserCancelledLastOperation(); } if (!hasUserCancelledOperation) { wizard = new WizardNew (WizardNew.StartPage.project); wizard.Text = "New Project Wizard"; wizard.ShowDialog(this); if (wizard.has_created_project) { ProjectForm2 child_project; // If a project is loaded, close the project and close all project forms if (_Project.IsProjectConstructed) { // The user already has indicated which unsaved changes needed to be saved, // so don't ask a second time. _Project.Close(false); CloseAlProjectForms(); } wizard.ConstructAndSaveProject(_Project); child_project = new ProjectForm2 (_Project, this); child_project.MdiParent = this; child_project.Show (); child_project.Activate(); // Make the project form update itself completely. child_project.Update(this, new UpdateAll()); } else { // No project is created using the wizard, but // changed project and/or changes sessions may have been saved. Notify(this, new Saved()); } UpdateUIControls (); } }
public void SessionAddNew() { WizardNew wizard; wizard = new WizardNew (WizardNew.StartPage.session); wizard.ShowDialog(this); if (wizard.has_created_session) { this.project.AddSession (wizard.GetSession()); this.UpdateSessionTreeView (); this.SessionBrowser.Select (); } }