예제 #1
0
파일: MainForm.cs 프로젝트: ewcasas/DVTK
        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 ();
            }
        }
예제 #2
0
파일: MainForm.cs 프로젝트: ewcasas/DVTK
        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 ();
            }
        }
예제 #3
0
파일: ProjectForm.cs 프로젝트: ewcasas/DVTK
        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 ();
            }
        }