diff --git a/SabreTools.DatFiles/Formats/ArchiveDotOrg.Writer.cs b/SabreTools.DatFiles/Formats/ArchiveDotOrg.Writer.cs index a64cd539..5065a16b 100644 --- a/SabreTools.DatFiles/Formats/ArchiveDotOrg.Writer.cs +++ b/SabreTools.DatFiles/Formats/ArchiveDotOrg.Writer.cs @@ -93,8 +93,14 @@ namespace SabreTools.DatFiles.Formats continue; // Loop through and convert the items to respective lists - foreach (var item in items) + for (int index = 0; index < items.Count; index++) { + // Get the item + var item = items[index]; + + // Check for a "null" item + item = ProcessNullifiedItem(item); + // Skip if we're ignoring the item if (ShouldIgnore(item, ignoreblanks)) continue; diff --git a/SabreTools.DatFiles/Formats/AttractMode.Writer.cs b/SabreTools.DatFiles/Formats/AttractMode.Writer.cs index fad1070a..5573c85c 100644 --- a/SabreTools.DatFiles/Formats/AttractMode.Writer.cs +++ b/SabreTools.DatFiles/Formats/AttractMode.Writer.cs @@ -89,8 +89,14 @@ namespace SabreTools.DatFiles.Formats continue; // Loop through and convert the items to respective lists - foreach (var item in items) + for (int index = 0; index < items.Count; index++) { + // Get the item + var item = items[index]; + + // Check for a "null" item + item = ProcessNullifiedItem(item); + // Skip if we're ignoring the item if (ShouldIgnore(item, ignoreblanks)) continue; diff --git a/SabreTools.DatFiles/Formats/ClrMamePro.Writer.cs b/SabreTools.DatFiles/Formats/ClrMamePro.Writer.cs index 292ab6a3..694323c1 100644 --- a/SabreTools.DatFiles/Formats/ClrMamePro.Writer.cs +++ b/SabreTools.DatFiles/Formats/ClrMamePro.Writer.cs @@ -254,8 +254,14 @@ namespace SabreTools.DatFiles.Formats var dipswitches = new List(); // Loop through and convert the items to respective lists - foreach (var item in items) + for (int index = 0; index < items.Count; index++) { + // Get the item + var item = items[index]; + + // Check for a "null" item + item = ProcessNullifiedItem(item); + // Skip if we're ignoring the item if (ShouldIgnore(item, ignoreblanks)) continue; diff --git a/SabreTools.DatFiles/Formats/DosCenter.Writer.cs b/SabreTools.DatFiles/Formats/DosCenter.Writer.cs index b787f2f0..57373dc2 100644 --- a/SabreTools.DatFiles/Formats/DosCenter.Writer.cs +++ b/SabreTools.DatFiles/Formats/DosCenter.Writer.cs @@ -140,8 +140,14 @@ namespace SabreTools.DatFiles.Formats var files = new List(); // Loop through and convert the items to respective lists - foreach (var item in items) + for (int index = 0; index < items.Count; index++) { + // Get the item + var item = items[index]; + + // Check for a "null" item + item = ProcessNullifiedItem(item); + // Skip if we're ignoring the item if (ShouldIgnore(item, ignoreblanks)) continue; diff --git a/SabreTools.DatFiles/Formats/EverdriveSMDB.Writer.cs b/SabreTools.DatFiles/Formats/EverdriveSMDB.Writer.cs index ab3fddf8..f89e17f2 100644 --- a/SabreTools.DatFiles/Formats/EverdriveSMDB.Writer.cs +++ b/SabreTools.DatFiles/Formats/EverdriveSMDB.Writer.cs @@ -106,8 +106,14 @@ namespace SabreTools.DatFiles.Formats continue; // Loop through and convert the items to respective lists - foreach (var item in items) + for (int index = 0; index < items.Count; index++) { + // Get the item + var item = items[index]; + + // Check for a "null" item + item = ProcessNullifiedItem(item); + // Skip if we're ignoring the item if (ShouldIgnore(item, ignoreblanks)) continue; diff --git a/SabreTools.DatFiles/Formats/Hashfile.Writer.cs b/SabreTools.DatFiles/Formats/Hashfile.Writer.cs index 5b78dc87..f259a2d0 100644 --- a/SabreTools.DatFiles/Formats/Hashfile.Writer.cs +++ b/SabreTools.DatFiles/Formats/Hashfile.Writer.cs @@ -226,8 +226,15 @@ namespace SabreTools.DatFiles.Formats if (items == null || !items.Any()) continue; - foreach (var item in items) + // Loop through and convert the items to respective lists + for (int index = 0; index < items.Count; index++) { + // Get the item + var item = items[index]; + + // Check for a "null" item + item = ProcessNullifiedItem(item); + // Skip if we're ignoring the item if (ShouldIgnore(item, ignoreblanks)) continue; @@ -268,8 +275,15 @@ namespace SabreTools.DatFiles.Formats if (items == null || !items.Any()) continue; - foreach (var item in items) + // Loop through and convert the items to respective lists + for (int index = 0; index < items.Count; index++) { + // Get the item + var item = items[index]; + + // Check for a "null" item + item = ProcessNullifiedItem(item); + // Skip if we're ignoring the item if (ShouldIgnore(item, ignoreblanks)) continue; @@ -326,8 +340,15 @@ namespace SabreTools.DatFiles.Formats if (items == null || !items.Any()) continue; - foreach (var item in items) + // Loop through and convert the items to respective lists + for (int index = 0; index < items.Count; index++) { + // Get the item + var item = items[index]; + + // Check for a "null" item + item = ProcessNullifiedItem(item); + // Skip if we're ignoring the item if (ShouldIgnore(item, ignoreblanks)) continue; @@ -384,8 +405,15 @@ namespace SabreTools.DatFiles.Formats if (items == null || !items.Any()) continue; - foreach (var item in items) + // Loop through and convert the items to respective lists + for (int index = 0; index < items.Count; index++) { + // Get the item + var item = items[index]; + + // Check for a "null" item + item = ProcessNullifiedItem(item); + // Skip if we're ignoring the item if (ShouldIgnore(item, ignoreblanks)) continue; @@ -434,8 +462,15 @@ namespace SabreTools.DatFiles.Formats if (items == null || !items.Any()) continue; - foreach (var item in items) + // Loop through and convert the items to respective lists + for (int index = 0; index < items.Count; index++) { + // Get the item + var item = items[index]; + + // Check for a "null" item + item = ProcessNullifiedItem(item); + // Skip if we're ignoring the item if (ShouldIgnore(item, ignoreblanks)) continue; @@ -476,8 +511,15 @@ namespace SabreTools.DatFiles.Formats if (items == null || !items.Any()) continue; - foreach (var item in items) + // Loop through and convert the items to respective lists + for (int index = 0; index < items.Count; index++) { + // Get the item + var item = items[index]; + + // Check for a "null" item + item = ProcessNullifiedItem(item); + // Skip if we're ignoring the item if (ShouldIgnore(item, ignoreblanks)) continue; @@ -518,8 +560,15 @@ namespace SabreTools.DatFiles.Formats if (items == null || !items.Any()) continue; - foreach (var item in items) + // Loop through and convert the items to respective lists + for (int index = 0; index < items.Count; index++) { + // Get the item + var item = items[index]; + + // Check for a "null" item + item = ProcessNullifiedItem(item); + // Skip if we're ignoring the item if (ShouldIgnore(item, ignoreblanks)) continue; diff --git a/SabreTools.DatFiles/Formats/Listrom.Writer.cs b/SabreTools.DatFiles/Formats/Listrom.Writer.cs index d8ca951b..3622cf49 100644 --- a/SabreTools.DatFiles/Formats/Listrom.Writer.cs +++ b/SabreTools.DatFiles/Formats/Listrom.Writer.cs @@ -120,8 +120,14 @@ namespace SabreTools.DatFiles.Formats }; // Loop through and convert the items to respective lists - foreach (var item in items) + for (int index = 0; index < items.Count; index++) { + // Get the item + var item = items[index]; + + // Check for a "null" item + item = ProcessNullifiedItem(item); + // Skip if we're ignoring the item if (ShouldIgnore(item, ignoreblanks)) continue; diff --git a/SabreTools.DatFiles/Formats/RomCenter.Writer.cs b/SabreTools.DatFiles/Formats/RomCenter.Writer.cs index 3b589760..f0c44c88 100644 --- a/SabreTools.DatFiles/Formats/RomCenter.Writer.cs +++ b/SabreTools.DatFiles/Formats/RomCenter.Writer.cs @@ -151,8 +151,14 @@ namespace SabreTools.DatFiles.Formats continue; // Loop through and convert the items to respective lists - foreach (var item in items) + for (int index = 0; index < items.Count; index++) { + // Get the item + var item = items[index]; + + // Check for a "null" item + item = ProcessNullifiedItem(item); + // Skip if we're ignoring the item if (ShouldIgnore(item, ignoreblanks)) continue; diff --git a/SabreTools.DatFiles/Formats/SeparatedValue.Writer.cs b/SabreTools.DatFiles/Formats/SeparatedValue.Writer.cs index 82ce9912..0d8a22cf 100644 --- a/SabreTools.DatFiles/Formats/SeparatedValue.Writer.cs +++ b/SabreTools.DatFiles/Formats/SeparatedValue.Writer.cs @@ -121,8 +121,14 @@ namespace SabreTools.DatFiles.Formats continue; // Loop through and convert the items to respective lists - foreach (var item in items) + for (int index = 0; index < items.Count; index++) { + // Get the item + var item = items[index]; + + // Check for a "null" item + item = ProcessNullifiedItem(item); + // Skip if we're ignoring the item if (ShouldIgnore(item, ignoreblanks)) continue; diff --git a/SabreTools.Serialization/XmlSerializer.Serializer.cs b/SabreTools.Serialization/XmlSerializer.Serializer.cs index 1b726856..0fa27c80 100644 --- a/SabreTools.Serialization/XmlSerializer.Serializer.cs +++ b/SabreTools.Serialization/XmlSerializer.Serializer.cs @@ -45,6 +45,7 @@ namespace SabreTools.Serialization CheckCharacters = false, Encoding = Encoding.UTF8, Indent = true, + IndentChars = "\t", NewLineChars = "\n", }; var stream = new MemoryStream();