public void DoDiff() { var total = src.files.Union(dst.files).ToList(); total.Sort(); results.Clear(); resultRevisions.Clear(); var md5Hash = MD5.Create(); foreach (var file in total) { var res = new DiffResult <string>(file, file, DiffStatus.Equal); var consrc = src.files.Contains(file); var condst = dst.files.Contains(file); if (consrc && !condst) { res.Obj2 = null; res.Status = DiffStatus.Deleted; } else if (!consrc && condst) { res.Obj1 = null; res.Status = DiffStatus.Inserted; } if (res.Status == DiffStatus.Equal) { // check md5 first //var hash1 = md5Hash.ComputeHash(File.OpenRead(src.root + file)); //var hash2 = md5Hash.ComputeHash(File.OpenRead(dst.root + file)); if (!DiffUtil.FilesAreEqual(src.root + file, dst.root + file)) { res.Status = DiffStatus.Modified; } } results.Add(res); } DstDataGrid.refreshData(); SrcDataGrid.refreshData(); }