/// <summary> /// Create a project with the given project name /// and project folder. /// </summary> private void CreateProject() { // Create the project Project prj = new Project(_ProjectName, _ProjectDirectory, SerialNumberGeneratorVM.SerialNumber.ToString()); // Set it to PulseManager _pm.AddNewProject(prj); _pm.SelectedProject = prj; // Process additional commands // Create the ADCP configuration for the project // Move to the next section _events.PublishOnUIThread(new ViewNavEvent(ViewNavEvent.ViewId.CommunicationsView)); }
/// <summary> /// Add a project to the list of projects. /// This will add the project to the database. /// It will also set the new project as the /// selected project. If the project already /// exist, it will display a messagebox warning. /// </summary> /// <param name="prj">Project to add.</param> public async Task AddProject(Project prj) { // Add project to DB _pm.AddNewProject(prj); await System.Windows.Application.Current.Dispatcher.BeginInvoke(new System.Action(() => { // Create the VM ProjectListItemViewModel newPrjVm = new ProjectListItemViewModel(prj, this); // Add project VM to the list ProjectList.Insert(0, newPrjVm); // Set the new project as the selected project SelectedProjectVM = newPrjVm; _pm.SelectedProject = prj; })); }