Пример #1
0
        private async Task CreateNewProject()
        {
            var success             = false;
            var newProjectViewModel = new NewProjectViewModel();
            var dialog = new NewProjectWindow {
                DataContext = newProjectViewModel
            };

#if (!DEBUG)
            try
            {
#endif
            newProjectViewModel.LastInputDirectory   = this.lastInputDirectory;
            newProjectViewModel.LastProjectDirectory = this.lastProjectDirectory;
            newProjectViewModel.LastOutputDirectory  = this.lastOutputDirectory;
            newProjectViewModel.UseProjectDirectory  = this.useProjectDirectoryAuto;

            newProjectViewModel.Success += (s, e) =>
            {
                success = true;
                dialog.Close();
            };
            dialog.ShowDialog();

            if (success)
            {
                this.ShowSplash = false;
                this.analysisConfig.AnalysisName = newProjectViewModel.ProjectFilePath;
                this.ProjectPath      = newProjectViewModel.ProjectFilePath;
                this.projectDirectory = Path.GetDirectoryName(this.projectPath) + Path.DirectorySeparatorChar;
                this.outputDirectory  = newProjectViewModel.OutputDirectory;
                await this.LoadRogueProject(true, newProjectViewModel.Datasets.Select(x => x.Dataset).ToList());

                this.PersistProject();

                this.lastInputDirectory      = newProjectViewModel.LastInputDirectory;
                this.lastProjectDirectory    = newProjectViewModel.LastProjectDirectory;
                this.lastOutputDirectory     = newProjectViewModel.LastOutputDirectory;
                this.useProjectDirectoryAuto = newProjectViewModel.UseProjectDirectory;

                this.RegistrySaveSettings();
            }
#if (!DEBUG)
        }

        catch (Exception ex)
        {
            Logger.PrintMessage("Exception creating a new project: " + ex.Message);
            MessageBox.Show("Exception creating the new project: " + ex.Message);
        }
#endif
        }
Пример #2
0
        private void CreateNewProject()
        {
            var success = false;
            var newProjectViewModel = new NewProjectViewModel();
            var dialog = new NewProjectWindow { DataContext = newProjectViewModel };
            newProjectViewModel.Success += (s, e) =>
                {
                    success = true;
                    dialog.Close();
                };
            dialog.ShowDialog();

            if (success)
            {
                var rogueProject = newProjectViewModel.GetRogueProject();
                rogueProject.MultiAlignAnalysisOptions = new MultiAlignAnalysisOptions();
                this.LoadRogueProject(rogueProject, true);
                this.Serialize(newProjectViewModel.ProjectFilePath);
                this.ProjectPath = newProjectViewModel.ProjectFilePath;
                this.outputDirectory = newProjectViewModel.OutputDirectory;
                this.RaisePropertyChanged("Analysis");
            }
        }