private static FileFindResult getResult(string x, string searchDir, string project, FileFindResultType typeWhenDirectory)
 {
     if (x.IndexOf(Path.DirectorySeparatorChar, searchDir.Length + 1) == -1)
         return new FileFindResult(FileFindResultType.File, x, project);
     else
         return new FileFindResult(typeWhenDirectory, x.Substring(0, x.IndexOf(Path.DirectorySeparatorChar, searchDir.Length + 1)), project);
 }
Exemple #2
0
        private void addFile(List <FileFindResult> list, FileFindResultType type, string x, string pattern)
        {
            var            start            = x.ToLower().LastIndexOf(pattern);
            var            nextDirSeparator = x.IndexOf(Path.DirectorySeparatorChar, start + pattern.Length);
            FileFindResult result;

            if (nextDirSeparator != -1)
            {
                result = new FileFindResult(FileFindResultType.Directory, x.Substring(0, nextDirSeparator));
            }
            else
            {
                result = new FileFindResult(type, x);
            }

            if (doesNotContain(list, result))
            {
                list.Add(result);
            }
        }
Exemple #3
0
 public FileFindResult(FileFindResultType type, string file, string projectPath)
 {
     Type        = type;
     File        = file;
     ProjectPath = projectPath;
 }
Exemple #4
0
 public FileFindResult(FileFindResultType type, string file)
 {
     Type        = type;
     File        = file;
     ProjectPath = null;
 }
Exemple #5
0
 public void Verify(int index, FileFindResultType type, string path, string projectPath)
 {
     Assert.That(_list[index].Type, Is.EqualTo(type));
     Assert.That(_list[index].File, Is.EqualTo(path));
     Assert.That(_list[index].ProjectPath, Is.EqualTo(projectPath));
 }
 public FileFindResult(FileFindResultType type, string file, string projectPath)
 {
     Type = type;
     File = file;
     ProjectPath = projectPath;
 }
 public FileFindResult(FileFindResultType type, string file)
 {
     Type = type;
     File = file;
     ProjectPath = null;
 }
 public void Verify(int index, FileFindResultType type, string path, string projectPath)
 {
     Assert.That(_list[index].Type, Is.EqualTo(type));
     Assert.That(_list[index].File, Is.EqualTo(path));
     Assert.That(_list[index].ProjectPath, Is.EqualTo(projectPath));
 }
Exemple #9
0
 private static FileFindResult getResult(string x, string searchDir, string project, FileFindResultType typeWhenDirectory)
 {
     if (x.IndexOf(Path.DirectorySeparatorChar, searchDir.Length + 1) == -1)
     {
         return(new FileFindResult(FileFindResultType.File, x, project));
     }
     else
     {
         return(new FileFindResult(typeWhenDirectory, x.Substring(0, x.IndexOf(Path.DirectorySeparatorChar, searchDir.Length + 1)), project));
     }
 }