private void SaveComparisonCache() { string cacheFileName = Path.Combine(Path.GetTempPath(), Path.GetFileName(_settingsService.LastProject) + ".cache"); if (AreAllVarietiesCompared) { using (FileStream fs = File.Create(cacheFileName)) { Serializer.SerializeWithLengthPrefix(fs, CacheVersion, PrefixStyle.Base128, 1); Serializer.SerializeWithLengthPrefix(fs, CalcProjectHash(), PrefixStyle.Base128, 1); foreach (VarietyPair vp in _project.VarietyPairs) { var surrogate = new VarietyPairSurrogate(vp); Serializer.SerializeWithLengthPrefix(fs, surrogate, PrefixStyle.Base128, 1); } } } else { if (File.Exists(cacheFileName)) { File.Delete(cacheFileName); } } }
private void SaveComparisonCache() { string cacheFileName = Path.Combine(Path.GetTempPath(), Path.GetFileName(_settingsService.LastProject) + ".cache"); if (AreAllVarietiesCompared) { using (FileStream fs = File.Create(cacheFileName)) { Serializer.SerializeWithLengthPrefix(fs, CacheVersion, PrefixStyle.Base128, 1); Serializer.SerializeWithLengthPrefix(fs, CalcProjectHash(), PrefixStyle.Base128, 1); foreach (VarietyPair vp in _project.VarietyPairs) { var surrogate = new VarietyPairSurrogate(vp); Serializer.SerializeWithLengthPrefix(fs, surrogate, PrefixStyle.Base128, 1); } } } else { if (File.Exists(cacheFileName)) File.Delete(cacheFileName); } }