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

@@ -171,7 +171,13 @@ namespace SabreTools.DatTools
try
{
// Write out all required formats
#if NET452_OR_GREATER || NETCOREAPP
Parallel.ForEach(outfiles.Keys, Globals.ParallelOptions, reportFormat =>
#elif NET40_OR_GREATER
Parallel.ForEach(outfiles.Keys, reportFormat =>
#else
foreach (var reportFormat in outfiles.Keys)
#endif
{
string outfile = outfiles[reportFormat];
try
@@ -223,19 +229,39 @@ namespace SabreTools.DatTools
// For each output format, get the appropriate stream writer
output.Add(StatReportFormat.None, CreateOutStatsNamesHelper(outDir, ".null", reportName, overwrite));
#if NETFRAMEWORK
if ((statDatFormat & StatReportFormat.Textfile) != 0)
#else
if (statDatFormat.HasFlag(StatReportFormat.Textfile))
#endif
output.Add(StatReportFormat.Textfile, CreateOutStatsNamesHelper(outDir, ".txt", reportName, overwrite));
#if NETFRAMEWORK
if ((statDatFormat & StatReportFormat.CSV) != 0)
#else
if (statDatFormat.HasFlag(StatReportFormat.CSV))
#endif
output.Add(StatReportFormat.CSV, CreateOutStatsNamesHelper(outDir, ".csv", reportName, overwrite));
#if NETFRAMEWORK
if ((statDatFormat & StatReportFormat.HTML) != 0)
#else
if (statDatFormat.HasFlag(StatReportFormat.HTML))
#endif
output.Add(StatReportFormat.HTML, CreateOutStatsNamesHelper(outDir, ".html", reportName, overwrite));
#if NETFRAMEWORK
if ((statDatFormat & StatReportFormat.SSV) != 0)
#else
if (statDatFormat.HasFlag(StatReportFormat.SSV))
#endif
output.Add(StatReportFormat.SSV, CreateOutStatsNamesHelper(outDir, ".ssv", reportName, overwrite));
#if NETFRAMEWORK
if ((statDatFormat & StatReportFormat.TSV) != 0)
#else
if (statDatFormat.HasFlag(StatReportFormat.TSV))
#endif
output.Add(StatReportFormat.TSV, CreateOutStatsNamesHelper(outDir, ".tsv", reportName, overwrite));
return output;