Esempio n. 1
0
        private void _generateNewProjectStructureOnDisk(object sender, EventArgs e)
        {
            _addProjectdialogbox.Close();
            var newProjectName = ((AddProjectViewModel)sender).NewProjectName;
            var nameExistsFlag = false;

            foreach (var prj in _projects)
            {
                if (prj.ProjectName == newProjectName)
                {
                    nameExistsFlag = true;
                    break;
                }
            }
            if (nameExistsFlag)
            {
                MessageBox.Show("Project exists, please give a new name!", "ERROR!", MessageBoxButton.OK);
                var _addProjectVM = new AddProjectViewModel();
                _addProjectVM.NameAccepted     += _generateNewProjectStructureOnDisk;
                _addProjectVM.NewTaskCancelled += _newProjectCancelled;
                _addProjectdialogbox            = new AddAProjectPopup
                {
                    Owner       = System.Windows.Application.Current.MainWindow,
                    DataContext = _addProjectVM
                };
                _addProjectdialogbox.ShowDialog();
            }
            else
            {
                var newProjectDir = ResultsStoragePath + "\\Project_" + newProjectName;
                Directory.CreateDirectory(newProjectDir);
                _model.GenerateProjectTree();
                _setupProjectTree();
            }
        }
Esempio n. 2
0
        private void _addAASProject(object obj)
        {
            var _addProjectVM = new AddProjectViewModel();

            _addProjectVM.NameAccepted     += _generateNewProjectStructureOnDisk;
            _addProjectVM.NewTaskCancelled += _newProjectCancelled;
            _addProjectdialogbox            = new AddAProjectPopup
            {
                Owner       = System.Windows.Application.Current.MainWindow,
                DataContext = _addProjectVM
            };
            _addProjectdialogbox.ShowDialog();
        }