Example #1
0
        internal void AddPrimitiveProject(PrimitiveProject primitiveProject, SolutionFolder solutionFolder = null)
        {
            var otherProject = PrimitiveProjects.FirstOrDefault(x => x.ProjectId.Equals(primitiveProject.ProjectId));

            ControlFlow.Assert(otherProject == null,
                               $"Cannot add '{primitiveProject.Name}' because its id '{primitiveProject.ProjectId}' is already taken by '{otherProject?.Name}'.");

            PrimitiveProjects.Add(primitiveProject);
            PrimitiveProjectParents.Add(primitiveProject, solutionFolder);
        }
Example #2
0
        public IReadOnlyCollection <PrimitiveProject> RemoveSolutionFolder(SolutionFolder solutionFolder)
        {
            var children = GetNestedPrimitiveProjects(solutionFolder);

            foreach (var child in children)
            {
                SetSolutionFolder(solutionFolder.SolutionFolder, child);
            }

            PrimitiveProjects.Remove(solutionFolder);

            return(children);
        }
Example #3
0
 public void RemoveProject(Project project)
 {
     PrimitiveProjects.Remove(project);
     PrimitiveProjectParents.Remove(project);
 }