bool CheckChanged(ChangeDetection detection, FileInfo file, FileEntry entry)
{
if (!file.Exists)
return true;
if ((detection & ChangeDetection.Length) != 0 && file.Length != entry.Length)
return true;
if ((detection & ChangeDetection.Timestamp) != 0 && file.LastWriteTimeUtc != entry.Timestamp)
return true;
if ((detection & ChangeDetection.Hash) != 0 && HashFile(file) != entry.Hash)
return true;
return false;
}