mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 23:50:18 -04:00
WIP Lib version 2.39.1
This commit is contained in:
@@ -111,23 +111,17 @@ namespace ModernKeePassLib.Translation
|
||||
if(xs == null) throw new ArgumentNullException("xs");
|
||||
|
||||
#if !KeePassLibSD
|
||||
GZipStream gz = new GZipStream(sOut, CompressionMode.Compress);
|
||||
using(GZipStream gz = new GZipStream(sOut, CompressionMode.Compress))
|
||||
#else
|
||||
GZipOutputStream gz = new GZipOutputStream(sOut);
|
||||
using(GZipOutputStream gz = new GZipOutputStream(sOut))
|
||||
#endif
|
||||
{
|
||||
using(XmlWriter xw = XmlUtilEx.CreateXmlWriter(gz))
|
||||
{
|
||||
xs.Serialize(xw, kpTrl);
|
||||
}
|
||||
}
|
||||
|
||||
XmlWriterSettings xws = new XmlWriterSettings();
|
||||
xws.CheckCharacters = true;
|
||||
xws.Encoding = StrUtil.Utf8;
|
||||
xws.Indent = true;
|
||||
xws.IndentChars = "\t";
|
||||
|
||||
XmlWriter xw = XmlWriter.Create(gz, xws);
|
||||
|
||||
xs.Serialize(xw, kpTrl);
|
||||
|
||||
xw.Close();
|
||||
gz.Close();
|
||||
sOut.Close();
|
||||
}
|
||||
|
||||
@@ -148,15 +142,17 @@ namespace ModernKeePassLib.Translation
|
||||
{
|
||||
if(xs == null) throw new ArgumentNullException("xs");
|
||||
|
||||
KPTranslation kpTrl = null;
|
||||
|
||||
#if !KeePassLibSD
|
||||
GZipStream gz = new GZipStream(s, CompressionMode.Decompress);
|
||||
using(GZipStream gz = new GZipStream(s, CompressionMode.Decompress))
|
||||
#else
|
||||
GZipInputStream gz = new GZipInputStream(s);
|
||||
using(GZipInputStream gz = new GZipInputStream(s))
|
||||
#endif
|
||||
{
|
||||
kpTrl = (xs.Deserialize(gz) as KPTranslation);
|
||||
}
|
||||
|
||||
KPTranslation kpTrl = (xs.Deserialize(gz) as KPTranslation);
|
||||
|
||||
gz.Close();
|
||||
s.Close();
|
||||
return kpTrl;
|
||||
}
|
||||
|
Reference in New Issue
Block a user