public static void Update(this List <BackupDetail> list) { var storedBackupDetails = BackupDetails.StoredBackupDetails(); list.ForEach(sbd => storedBackupDetails.UpdateSingle(sbd)); storedBackupDetails.Save(); }
public static string GetHTMLDiff(this List <BackupDetail> list, string id) { var backupDetail = list.Get(id); var localFileLocation = Path.Combine(BackupDetails.ServerDir(), backupDetail.BackupDirectory.ToString(), backupDetail.SavedName); var remoteFileLocation = Path.Combine(BackupDetails.ServerDir(), "temp", backupDetail.ActualName); var localFileContents = File.ReadAllText(localFileLocation); var remoteFileContents = File.ReadAllText(remoteFileLocation); diff_match_patch dmp = new diff_match_patch(); List <Diff> diff = dmp.diff_main(localFileContents, remoteFileContents); dmp.diff_cleanupSemantic(diff); var html = dmp.diff_prettyHtml(diff).Replace("¶", ""); return(html); }