Ejemplo n.º 1
0
 public void Add(Project project)
 {
     lock (_projects)
     {
         _projects.Add(project);
     }
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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"));
        }
Ejemplo n.º 7
0
 public bool ProjectExists(Project project)
 {
     return _projects.Exists(x => x.File.Equals(project.File));
 }
Ejemplo n.º 8
0
 public void Add(Project project)
 {
 }
Ejemplo n.º 9
0
 public string Format(Project project)
 {
     return string.Format("project|{0}",
         project.File);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 13
0
 public string Format(Project project)
 {
     return string.Format("project|{0}|{1}",
         project.File, project.JSON);
 }