public Boolean AddProjectFile(ProjectFile pf) { if (ProjectFiles.Contains(pf)) { // TODO: maybe the build system is dumb and recompiles the same file multiple times? return(false); } ProjectFiles.Add(pf); if (pf.ProjectFolder != null) { // create project structure RelativeCrosspath projectFolder = new RelativeCrosspath(pf.ProjectFolder); Stack <String> todo = new Stack <String>(); while (true) { String fldr = projectFolder.ToString().Replace('/', '\\'); if (fldr == "." || ProjectFilters.Contains(fldr)) { break; } todo.Push(fldr); projectFolder.ToContainingDirectory(); } foreach (String filter in todo) { ProjectFilters.Add(filter); } } return(true); }