Esempio n. 1
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);
 }
Esempio n. 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);
            }
        }
Esempio n. 3
0
 public FileFindResult(FileFindResultType type, string file, string projectPath)
 {
     Type        = type;
     File        = file;
     ProjectPath = projectPath;
 }
Esempio n. 4
0
 public FileFindResult(FileFindResultType type, string file)
 {
     Type        = type;
     File        = file;
     ProjectPath = null;
 }
Esempio n. 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));
 }
Esempio n. 6
0
 public FileFindResult(FileFindResultType type, string file, string projectPath)
 {
     Type = type;
     File = file;
     ProjectPath = projectPath;
 }
Esempio n. 7
0
 public FileFindResult(FileFindResultType type, string file)
 {
     Type = type;
     File = file;
     ProjectPath = null;
 }
Esempio n. 8
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));
 }
Esempio n. 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));
     }
 }