예제 #1
0
        public void CreateNewProject(WizardEventHandler wizardEventHandler)
        {
            NewProjectDialog npd = new NewProjectDialog(null);

            npd = new NewProjectDialog(null);
            if (this.CurrentWizard != null)
            {
                this.CurrentWizard.DialogOpened(npd);
            }
            toolStripStatusLabel.Text = "Creating new project";
            if (npd.ShowDialog() == DialogResult.OK)
            {
                //OpeningSpectraCount = 0;
                tsMainProgressBar.Maximum = 0;
                tsMainProgressBar.Visible = true;
                //toolStripStatusLabel.Text = String.Format("Creating Project {0}...", npd.projectNameTextBox.Text);
                foreach (SpectraContainerDescription scd in npd.ContainerDescriptions)
                {
                    tsMainProgressBar.Maximum += scd.spectraPaths.Length;
                }
                string   defaultProjectName = getDefaultProjectName();
                IProject project            = AvailableAssemblies.getProject(
                    npd.ProjectType.ToString(),
                    new object[] {
                    defaultProjectName,     //npd.projectNameTextBox.Text,
                    npd.ContainerDescriptions
                });
                //project.Save(System.IO.Path.Combine(npd.projectPathTextBox.Text, npd.projectNameTextBox.Text), false);
                ProjectForm form = CreateProjectWindow(project);
                form.NotSavedChanges      = true;
                tsMainProgressBar.Visible = false;
                if (wizardEventHandler != null)
                {
                    wizardEventHandler(this, new WizardEventArgs(form, WizardEventType.Created));
                }
            }
            if (CurrentWizard != null)
            {
                CurrentWizard.DialogClosed();
            }
            npd.Dispose();
            toolStripStatusLabel.Text = "Ready";
        }