Example #1
0
 public void Add(Project project)
 {
     lock (_projects)
     {
         _projects.Add(project);
     }
 }
 private bool filter(Project reference, Query query)
 {
     if (query == null)
         return true;
     if (query.File != null && !wildcardmatch(reference.File, query.File))
         return false;
     return true;
 }
Example #3
0
 private void handleProject(string[] chunks)
 {
     _currentProject = chunks[1];
     var project = new Project(_currentProject);
     var args = getArguments(chunks, 2);
     if (args.Contains("filesearch"))
         project.SetFileSearch();
     _builder.Add(project);
 }
Example #4
0
 public List<FileFindResult> GetNextStepInProject(Project project, string directory)
 {
     var list = new List<FileFindResult>();
     _files
         .Where(x => x.Project != null && x.Project.Equals(project.File) &&
                     (Path.GetDirectoryName(project.File).Equals(directory) || x.File.StartsWith(directory)))
         .Select(x => getResult(x.File, directory, project.File, FileFindResultType.DirectoryInProject)).ToList()
         .ForEach(x => addResult(list, x));
     return list;
 }
Example #5
0
 public void Add(Project project)
 {
     lock (_projects)
     {
         var existing = _projects.FirstOrDefault(x => x.File == project.File);
         if (existing == null) {
             _projects.Add(project);
             return;
         }
         existing.Update(project.JSON, project.FileSearch);
     }
 }
        public void When_given_a_project_and_a_directory_it_will_pull_out_files_and_directories_contained_by_it()
        {
            var cache = new TypeCache();
            var project = new Project(to("/Some/Path/MyProject.csproj"), "");
            cache.Add(toFile("/Some/Path/File1.cs", project.File));
            cache.Add(toFile("/Some/Path/File2.cs", project.File));
            cache.Add(toFile("/Some/Path/In/AnotherpathPlace/File2.cs", project.File));
            cache.Add(toFile("/Some/Path/In/AnotherpathPlace/File3.cs", project.File));
            cache.Add(project);
            cache.Add(toFile("/Some/Path/In/FileNotInProject.cs"));

            var verifier = new ResultVerifier(cache.GetFilesInProject(to("/Some/Path/MyProject.csproj"), to("/Some/Path/In")));
            verifier.VerifyCount(1);
            verifier.Verify(0, FileFindResultType.DirectoryInProject, to("/Some/Path/In/AnotherpathPlace"), to("/Some/Path/MyProject.csproj"));
        }
Example #7
0
 public bool ProjectExists(Project project)
 {
     return _projects.Exists(x => x.File.Equals(project.File));
 }
Example #8
0
 public void Add(Project project)
 {
 }
Example #9
0
 public string Format(Project project)
 {
     return string.Format("project|{0}",
         project.File);
 }
Example #10
0
 public List<FileFindResult> GetNextStepInProject(Project project)
 {
     return GetNextStepInProject(project, Path.GetDirectoryName(project.File));
 }
 public bool ProjectExists(Project project)
 {
     return false;
 }
 public void Add(Project project)
 {
     Projects.Add(project);
 }
Example #13
0
 public string Format(Project project)
 {
     return string.Format("project|{0}|{1}",
         project.File, project.JSON);
 }