Add search monitor

This commit is contained in:
qianlifeng
2014-11-03 18:49:18 +08:00
parent 9481d04a19
commit 3c4a9a05a0
4 changed files with 42 additions and 49 deletions

View File

@@ -17,17 +17,20 @@ namespace Wox.Plugin.FindFile.MFTSearch
public void AddRecord(string volume, List<USNRecord> r)
{
CheckHashTableKey(volume);
EnsureVolumeExistInHashTable(volume);
r.ForEach(x => VolumeRecords[volume].Add(x.FRN, x));
}
public void AddRecord(string volume, USNRecord record)
{
CheckHashTableKey(volume);
VolumeRecords[volume].Add(record.FRN, record);
EnsureVolumeExistInHashTable(volume);
if (!VolumeRecords[volume].ContainsKey(record.FRN))
{
VolumeRecords[volume].Add(record.FRN, record);
}
}
public void CheckHashTableKey(string volume)
public void EnsureVolumeExistInHashTable(string volume)
{
if (!VolumeRecords.ContainsKey(volume))
VolumeRecords.Add(volume, new Dictionary<ulong, USNRecord>());