public bool GetLocalFileModified(FileStateInfo info, string localPath, string vcsPath, DateTime projectDate, out FileBaseInfoState fileState, DateTime lastWrite) { try { using (Stream fileStream = fileSystem.OpenRead(localPath)) { byte[] localHash = DXVCSHelpers.GetHashMD5(fileStream); bool hashEquals = DXVCSHelpers.BytesAreEquals(localHash, info.Hash); fileState = FileBaseInfoState.Modified; return(!hashEquals); } } catch (IOException) { fileState = FileBaseInfoState.Locked; return(false); } }
public bool GetLocalFileModified(FileStateInfo info, string localPath, string vcsPath, DateTime projectDate, out FileBaseInfoState fileState, DateTime lastWrite) { try { using (Stream fileStream = fileSystem.OpenRead(localPath)) { byte[] localHash = DXVCSHelpers.GetHashMD5(fileStream); bool hashEquals = DXVCSHelpers.BytesAreEquals(localHash, info.Hash); fileState = FileBaseInfoState.Modified; return !hashEquals; } } catch (IOException) { fileState = FileBaseInfoState.Locked; return false; } }