Add find file plugin.

This commit is contained in:
qianlifeng
2014-10-22 22:49:34 +08:00
parent 581423a87c
commit 80e38fc430
23 changed files with 478 additions and 203 deletions

View File

@@ -85,22 +85,19 @@ namespace Wox.Infrastructure.MFTSearch
return false;
}
}
public List<USNRecord> FindByName(string filename, out long foundFileCnt, out long fountFolderCnt)
public List<USNRecord> FindByName(string filename)
{
filename = filename.ToLower();
var fileQuery = from filesInVolumeDic in _volumes_files.Values
from eachFilePair in filesInVolumeDic
where eachFilePair.Value.Name.Contains(filename)
where eachFilePair.Value.Name.ToLower().Contains(filename)
select eachFilePair.Value;
var folderQuery = from fldsInVolumeDic in _volumes_folders.Values
from eachFldPair in fldsInVolumeDic
where eachFldPair.Value.Name.Contains(filename)
where eachFldPair.Value.Name.ToLower().Contains(filename)
select eachFldPair.Value;
foundFileCnt = fileQuery.Count();
fountFolderCnt = folderQuery.Count();
List<USNRecord> result = new List<USNRecord>();
result.AddRange(fileQuery);