Esempio n. 1
0
 private void addResult(List <FileFindResult> list, FileFindResult x)
 {
     if (list.Count(y => y.File.Equals(x.File) && y.Type.Equals(x.Type)) == 0)
     {
         list.Add(x);
     }
 }
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
 private void addResult(List<FileFindResult> list, FileFindResult x)
 {
     if (list.Count(y => y.File.Equals(x.File) && y.Type.Equals(x.Type)) == 0)
         list.Add(x);
 }
 private void addNode(TreeNodeCollection nodes, string name, FileFindResult result)
 {
     int image = 0;
     if (result.Type == FileFindResultType.File)
         image = 4;
     if (result.Type == FileFindResultType.Project)
         image = 5;
     var node = nodes.Add(name);
     node.ImageIndex = image;
     node.SelectedImageIndex = image;
     node.Tag = result;
     if (isDirectory(result))
         node.Nodes.Add("");
 }
 private static bool isDirectory(FileFindResult x)
 {
     return x.Type == FileFindResultType.Directory || x.Type == FileFindResultType.DirectoryInProject;
 }
Esempio n. 6
0
 private bool doesNotContain(List <FileFindResult> list, FileFindResult result)
 {
     return(list.Where(x => x.Type == result.Type && x.File == result.File).Count() == 0);
 }