private List<DuplicateArchiveInfo> CalculateCRC(List<FileInfo> fileList, DuplicateSearchOption option)
{
List<DuplicateArchiveInfo> list = new List<DuplicateArchiveInfo>();
int i = 0;
foreach (FileInfo f in fileList)
{
_pauseEvent.WaitOne(Timeout.Infinite);
if (_shutdownEvent.WaitOne(0))
break;
NotifyCaller(f.FullName, OperationStatus.CALCULATING_CRC, curr:i, total:fileList.Count);
try
{
DuplicateArchiveInfo item = Util.GetArchiveInfo(f.FullName, option);
item.FileSize = f.Length;
item.CreationTime = f.CreationTime;
list.Add(item);
}
catch (Exception ex)
{
string message = ex.Message + " (" + f.FullName + ")";
NotifyCaller(message, OperationStatus.ERROR);
}
++i;
}
NotifyCaller("Complete calculating CRC, total: " + list.Count, OperationStatus.CALCULATING_CRC, total:list.Count);
return list;
}