Support ancient .NET in DatFiles

This commit is contained in:
Matt Nadareski
2024-02-28 22:54:56 -05:00
parent e7c45c1f50
commit 2145245c31
38 changed files with 780 additions and 258 deletions

View File

@@ -30,7 +30,9 @@ namespace SabreTools.DatFiles.Formats
XmlReader? xtr = XmlReader.Create(filename, new XmlReaderSettings
{
CheckCharacters = false,
#if NET40_OR_GREATER
DtdProcessing = DtdProcessing.Ignore,
#endif
IgnoreComments = true,
IgnoreWhitespace = true,
ValidationFlags = XmlSchemaValidationFlags.None,
@@ -83,7 +85,9 @@ namespace SabreTools.DatFiles.Formats
xtr?.Read();
}
#if NET452_OR_GREATER
xtr?.Dispose();
#endif
}
/// <summary>
@@ -246,7 +250,9 @@ namespace SabreTools.DatFiles.Formats
WriteFooter(xtw);
logger.User($"'{outfile}' written!{Environment.NewLine}");
#if NET452_OR_GREATER
xtw.Dispose();
#endif
fs.Dispose();
}
catch (Exception ex) when (!throwOnError)