示例#1
0
        private static void ShowDiff(string beforeFilepath, string afterFilepath)
        {
            var dateTime   = DateTime.Now;
            var beforeFile = GetFilePathInTempDirectory($"before.{ToString(dateTime)}{Path.GetExtension(beforeFilepath)}");
            var afterFile  = GetFilePathInTempDirectory($"after.{ToString(dateTime)}{Path.GetExtension(afterFilepath)}");

            File.Copy(beforeFilepath, beforeFile);
            File.Copy(afterFilepath, afterFile);

            TortoiseGitMerge.Compare(beforeFile, afterFile);
        }
示例#2
0
        private static void ShowDocxDiff(string beforeFilepath, string afterFilepath)
        {
            var dateTime       = DateTime.Now;
            var beforeTextFile = GetFilePathInTempDirectory($"before.{ToString(dateTime)}.docx.txt");
            var afterTextFile  = GetFilePathInTempDirectory($"after.{ToString(dateTime)}.docx.txt");

            ConvertDocxToTextFile(beforeFilepath, beforeTextFile);
            ConvertDocxToTextFile(afterFilepath, afterTextFile);

            TortoiseGitMerge.Compare(beforeTextFile, afterTextFile);
        }