public static string SerializeVersionToXmlString(PaperVersionInfo info)
 {
     XmlSerializer serializer = new XmlSerializer(typeof(PaperVersionInfo));
     using (MemoryStream stream = new MemoryStream())
     {
         serializer.Serialize(stream, info);
         return System.Text.Encoding.Default.GetString(stream.ToArray()).Replace("\r", string.Empty).Replace("\n", string.Empty);
     }
 }
 public static void LogVersion(int paperId, string path, bool isCorrection)
 {
     lock (lockTrigger)
     {
         string vLog = pathToWorkingDirectory + paperId + "\\version.log";
         int versiondId = 0;
         var versions = GetVersionHistory(paperId);
         if (versions.Keys.Count > 0)
             versiondId = versions.Keys.Max() + 1;
         System.Security.Cryptography.SHA256 hash = System.Security.Cryptography.SHA256.Create();
         PaperVersionInfo info = new PaperVersionInfo(paperId, versiondId, path, BitConverter.ToString(hash.ComputeHash(File.ReadAllBytes(path)), 0).Replace("-", string.Empty), isCorrection);
         File.AppendAllText(vLog, PaperVersionInfo.SerializeVersionToXmlString(info) + "\r\n");
     }
 }