mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add some XML serialization attributes
This commit is contained in:
@@ -6,6 +6,7 @@ using System.Linq;
|
|||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
using SabreTools.Library.Data;
|
using SabreTools.Library.Data;
|
||||||
using SabreTools.Library.DatItems;
|
using SabreTools.Library.DatItems;
|
||||||
@@ -24,6 +25,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
/// Represents a format-agnostic DAT
|
/// Represents a format-agnostic DAT
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonObject("datfile")]
|
[JsonObject("datfile")]
|
||||||
|
[XmlRoot("datfile")]
|
||||||
public abstract class DatFile
|
public abstract class DatFile
|
||||||
{
|
{
|
||||||
#region Fields
|
#region Fields
|
||||||
@@ -32,12 +34,14 @@ namespace SabreTools.Library.DatFiles
|
|||||||
/// Header values
|
/// Header values
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("header")]
|
[JsonProperty("header")]
|
||||||
|
[XmlElement("header")]
|
||||||
public DatHeader Header { get; set; } = new DatHeader();
|
public DatHeader Header { get; set; } = new DatHeader();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// DatItems and related statistics
|
/// DatItems and related statistics
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("items")]
|
[JsonProperty("items")]
|
||||||
|
[XmlElement("items")]
|
||||||
public ItemDictionary Items { get; set; } = new ItemDictionary();
|
public ItemDictionary Items { get; set; } = new ItemDictionary();
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
using SabreTools.Library.DatItems;
|
using SabreTools.Library.DatItems;
|
||||||
using SabreTools.Library.IO;
|
using SabreTools.Library.IO;
|
||||||
@@ -14,6 +15,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
/// Represents all possible DAT header information
|
/// Represents all possible DAT header information
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonObject("header")]
|
[JsonObject("header")]
|
||||||
|
[XmlRoot("header")]
|
||||||
public class DatHeader : ICloneable
|
public class DatHeader : ICloneable
|
||||||
{
|
{
|
||||||
#region Fields
|
#region Fields
|
||||||
@@ -24,108 +26,126 @@ namespace SabreTools.Library.DatFiles
|
|||||||
/// External name of the DAT
|
/// External name of the DAT
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("filename", DefaultValueHandling = DefaultValueHandling.Include)]
|
[JsonProperty("filename", DefaultValueHandling = DefaultValueHandling.Include)]
|
||||||
|
[XmlElement("filename")]
|
||||||
public string FileName { get; set; }
|
public string FileName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Internal name of the DAT
|
/// Internal name of the DAT
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("name", DefaultValueHandling = DefaultValueHandling.Include)]
|
[JsonProperty("name", DefaultValueHandling = DefaultValueHandling.Include)]
|
||||||
|
[XmlElement("name")]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// DAT description
|
/// DAT description
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("description", DefaultValueHandling = DefaultValueHandling.Include)]
|
[JsonProperty("description", DefaultValueHandling = DefaultValueHandling.Include)]
|
||||||
|
[XmlElement("description")]
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Root directory for the files; currently TruRip/EmuARC-exclusive
|
/// Root directory for the files; currently TruRip/EmuARC-exclusive
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("rootdir", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("rootdir", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("rootdir")]
|
||||||
public string RootDir { get; set; }
|
public string RootDir { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// General category of items found in the DAT
|
/// General category of items found in the DAT
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("category", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("category", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("category")]
|
||||||
public string Category { get; set; }
|
public string Category { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Version of the DAT
|
/// Version of the DAT
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("version", DefaultValueHandling = DefaultValueHandling.Include)]
|
[JsonProperty("version", DefaultValueHandling = DefaultValueHandling.Include)]
|
||||||
|
[XmlElement("version")]
|
||||||
public string Version { get; set; }
|
public string Version { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creation or modification date
|
/// Creation or modification date
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("date", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("date", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("date")]
|
||||||
public string Date { get; set; }
|
public string Date { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// List of authors who contributed to the DAT
|
/// List of authors who contributed to the DAT
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("author", DefaultValueHandling = DefaultValueHandling.Include)]
|
[JsonProperty("author", DefaultValueHandling = DefaultValueHandling.Include)]
|
||||||
|
[XmlElement("author")]
|
||||||
public string Author { get; set; }
|
public string Author { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Email address for DAT author(s)
|
/// Email address for DAT author(s)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("email", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("email", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("email")]
|
||||||
public string Email { get; set; }
|
public string Email { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Author or distribution homepage name
|
/// Author or distribution homepage name
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("homepage", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("homepage", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("homepage")]
|
||||||
public string Homepage { get; set; }
|
public string Homepage { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Author or distribution URL
|
/// Author or distribution URL
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("url", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("url", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("url")]
|
||||||
public string Url { get; set; }
|
public string Url { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Any comment that does not already fit an existing field
|
/// Any comment that does not already fit an existing field
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("comment", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("comment", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("comment")]
|
||||||
public string Comment { get; set; }
|
public string Comment { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Header skipper to be used when loading the DAT
|
/// Header skipper to be used when loading the DAT
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("header", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("header", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("header")]
|
||||||
public string HeaderSkipper { get; set; }
|
public string HeaderSkipper { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Classification of the DAT. Generally only used for SuperDAT
|
/// Classification of the DAT. Generally only used for SuperDAT
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("type", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("type", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("type")]
|
||||||
public string Type { get; set; }
|
public string Type { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Force a merging style when loaded
|
/// Force a merging style when loaded
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("forcemerging", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("forcemerging", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("forcemerging")]
|
||||||
public MergingFlag ForceMerging { get; set; }
|
public MergingFlag ForceMerging { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Force nodump handling when loaded
|
/// Force nodump handling when loaded
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("forcenodump", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("forcenodump", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("forcenodump")]
|
||||||
public NodumpFlag ForceNodump { get; set; }
|
public NodumpFlag ForceNodump { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Force output packing when loaded
|
/// Force output packing when loaded
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("forcepacking", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("forcepacking", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("forcepacking")]
|
||||||
public PackingFlag ForcePacking { get; set; }
|
public PackingFlag ForcePacking { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Read or write format
|
/// Read or write format
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
[XmlIgnore]
|
||||||
public DatFormat DatFormat { get; set; }
|
public DatFormat DatFormat { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -137,12 +157,14 @@ namespace SabreTools.Library.DatFiles
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>Also in Logiqx</remarks>
|
/// <remarks>Also in Logiqx</remarks>
|
||||||
[JsonProperty("debug", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("debug", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("debug")]
|
||||||
public bool? Debug { get; set; } = null;
|
public bool? Debug { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// MAME configuration name
|
/// MAME configuration name
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("mameconfig", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("mameconfig", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("mameconfig")]
|
||||||
public string MameConfig { get; set; }
|
public string MameConfig { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -153,12 +175,14 @@ namespace SabreTools.Library.DatFiles
|
|||||||
/// Build version
|
/// Build version
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("build", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("build", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("build")]
|
||||||
public string Build { get; set; }
|
public string Build { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Logiqx/RomCenter plugin, OfflineList System
|
/// Logiqx/RomCenter plugin, OfflineList System
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("system", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("system", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("system")]
|
||||||
public string System { get; set; }
|
public string System { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -166,6 +190,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>(merged|split|unmerged) "split"</remarks>
|
/// <remarks>(merged|split|unmerged) "split"</remarks>
|
||||||
[JsonProperty("rommode", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("rommode", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("rommode")]
|
||||||
public MergingFlag RomMode { get; set; }
|
public MergingFlag RomMode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -173,6 +198,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>(merged|split|unmerged) "split"</remarks>
|
/// <remarks>(merged|split|unmerged) "split"</remarks>
|
||||||
[JsonProperty("biosmode", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("biosmode", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("biosmode")]
|
||||||
public MergingFlag BiosMode { get; set; }
|
public MergingFlag BiosMode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -180,24 +206,28 @@ namespace SabreTools.Library.DatFiles
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>(merged|unmerged) "merged"</remarks>
|
/// <remarks>(merged|unmerged) "merged"</remarks>
|
||||||
[JsonProperty("samplemode", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("samplemode", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("samplemode")]
|
||||||
public MergingFlag SampleMode { get; set; }
|
public MergingFlag SampleMode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// RomCenter lock rom mode
|
/// RomCenter lock rom mode
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("lockrommode", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("lockrommode", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("lockrommode")]
|
||||||
public bool? LockRomMode { get; set; }
|
public bool? LockRomMode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// RomCenter lock bios mode
|
/// RomCenter lock bios mode
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("lockbiosmode", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("lockbiosmode", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("lockbiosmode")]
|
||||||
public bool? LockBiosMode { get; set; }
|
public bool? LockBiosMode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// RomCenter lock sample mode
|
/// RomCenter lock sample mode
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("locksamplemode", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("locksamplemode", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("locksamplemode")]
|
||||||
public bool? LockSampleMode { get; set; }
|
public bool? LockSampleMode { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -208,6 +238,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
/// Output the item name
|
/// Output the item name
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
[XmlIgnore]
|
||||||
public bool UseRomName { get; set; }
|
public bool UseRomName { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -218,24 +249,28 @@ namespace SabreTools.Library.DatFiles
|
|||||||
/// Screenshots width
|
/// Screenshots width
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("screenshotswidth", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("screenshotswidth", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("screenshotswidth")]
|
||||||
public string ScreenshotsWidth { get; set; }
|
public string ScreenshotsWidth { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Screenshots height
|
/// Screenshots height
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("screenshotsheight", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("screenshotsheight", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("screenshotsheight")]
|
||||||
public string ScreenshotsHeight { get; set; }
|
public string ScreenshotsHeight { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// OfflineList info list
|
/// OfflineList info list
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("infos", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("infos", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("infos")]
|
||||||
public List<OfflineListInfo> Infos { get; set; }
|
public List<OfflineListInfo> Infos { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// OfflineList can-open extensions
|
/// OfflineList can-open extensions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("canopen", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("canopen", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("canopen")]
|
||||||
public List<string> CanOpen { get; set; }
|
public List<string> CanOpen { get; set; }
|
||||||
|
|
||||||
// TODO: Implement the following header values:
|
// TODO: Implement the following header values:
|
||||||
@@ -250,6 +285,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
/// Rom title
|
/// Rom title
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("romtitle", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("romtitle", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("romtitle")]
|
||||||
public string RomTitle { get; set; }
|
public string RomTitle { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -260,6 +296,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
/// RomCenter DAT format version
|
/// RomCenter DAT format version
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("rcversion", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("rcversion", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("rcversion")]
|
||||||
public string RomCenterVersion { get; set; }
|
public string RomCenterVersion { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -270,58 +307,123 @@ namespace SabreTools.Library.DatFiles
|
|||||||
/// Text to prepend to all outputted lines
|
/// Text to prepend to all outputted lines
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
[XmlIgnore]
|
||||||
public string Prefix { get; set; }
|
public string Prefix { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Text to append to all outputted lines
|
/// Text to append to all outputted lines
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
[XmlIgnore]
|
||||||
public string Postfix { get; set; }
|
public string Postfix { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add a new extension to all items
|
/// Add a new extension to all items
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
[XmlIgnore]
|
||||||
public string AddExtension { get; set; }
|
public string AddExtension { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Replace all item extensions
|
/// Replace all item extensions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
[XmlIgnore]
|
||||||
public string ReplaceExtension { get; set; }
|
public string ReplaceExtension { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Remove all item extensions
|
/// Remove all item extensions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
[XmlIgnore]
|
||||||
public bool RemoveExtension { get; set; }
|
public bool RemoveExtension { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Output the machine name
|
/// Output the machine name
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
[XmlIgnore]
|
||||||
public bool GameName { get; set; }
|
public bool GameName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Wrap quotes around the entire line, sans prefix and postfix
|
/// Wrap quotes around the entire line, sans prefix and postfix
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
[XmlIgnore]
|
||||||
public bool Quotes { get; set; }
|
public bool Quotes { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region XML Serialization Nullable Specifications
|
||||||
|
|
||||||
|
#region Common
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool ForceMergingSpecified { get { return ForceMerging != MergingFlag.None; } }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool ForceNodumpSpecified { get { return ForceNodump != NodumpFlag.None; } }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool ForcePackingSpecified { get { return ForcePacking != PackingFlag.None; } }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region ListXML
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool DebugSpecified { get { return Debug != null; } }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Logiqx
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool RomModeSpecified { get { return RomMode != MergingFlag.None; } }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool BiosModeSpecified { get { return BiosMode != MergingFlag.None; } }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool SampleModeSpecified { get { return SampleMode != MergingFlag.None; } }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool LockRomModeSpecified { get { return LockRomMode != null; } }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool LockBiosModeSpecified { get { return LockBiosMode != null; } }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool LockSampleModeSpecified { get { return LockSampleMode != null; } }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region OfflineList
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool InfosSpecified { get { return Infos != null; } }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool CanOpenSpecified { get { return CanOpen != null; } }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion // XML Serialization Nullable Specifications
|
||||||
|
|
||||||
#region Depot Information
|
#region Depot Information
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Input depot information
|
/// Input depot information
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
[XmlIgnore]
|
||||||
public DepotInformation InputDepot { get; set; }
|
public DepotInformation InputDepot { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Output depot information
|
/// Output depot information
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
[XmlIgnore]
|
||||||
public DepotInformation OutputDepot { get; set; }
|
public DepotInformation OutputDepot { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -1,13 +1,6 @@
|
|||||||
using System;
|
using System.Xml.Serialization;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
using SabreTools.Library.DatItems;
|
|
||||||
using SabreTools.Library.Filtering;
|
|
||||||
using SabreTools.Library.Tools;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Converters;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This holds all of the auxiliary types needed for proper parsing
|
/// This holds all of the auxiliary types needed for proper parsing
|
||||||
@@ -22,6 +15,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// Represents the OpenMSX original value
|
/// Represents the OpenMSX original value
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonObject("original")]
|
[JsonObject("original")]
|
||||||
|
[XmlRoot("original")]
|
||||||
public class Original
|
public class Original
|
||||||
{
|
{
|
||||||
[JsonProperty("value")]
|
[JsonProperty("value")]
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
using SabreTools.Library.Data;
|
using SabreTools.Library.Data;
|
||||||
using SabreTools.Library.FileTypes;
|
using SabreTools.Library.FileTypes;
|
||||||
@@ -17,6 +18,44 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// Base class for all items included in a set
|
/// Base class for all items included in a set
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonObject("datitem")]
|
[JsonObject("datitem")]
|
||||||
|
[XmlRoot("datitem")]
|
||||||
|
[XmlInclude(typeof(Adjuster))]
|
||||||
|
[XmlInclude(typeof(Analog))]
|
||||||
|
[XmlInclude(typeof(Archive))]
|
||||||
|
[XmlInclude(typeof(BiosSet))]
|
||||||
|
[XmlInclude(typeof(Blank))]
|
||||||
|
[XmlInclude(typeof(Chip))]
|
||||||
|
[XmlInclude(typeof(Condition))]
|
||||||
|
[XmlInclude(typeof(Configuration))]
|
||||||
|
[XmlInclude(typeof(Control))]
|
||||||
|
[XmlInclude(typeof(DataArea))]
|
||||||
|
[XmlInclude(typeof(Device))]
|
||||||
|
[XmlInclude(typeof(DeviceReference))]
|
||||||
|
[XmlInclude(typeof(DipSwitch))]
|
||||||
|
[XmlInclude(typeof(Disk))]
|
||||||
|
[XmlInclude(typeof(DiskArea))]
|
||||||
|
[XmlInclude(typeof(Display))]
|
||||||
|
[XmlInclude(typeof(Driver))]
|
||||||
|
[XmlInclude(typeof(Extension))]
|
||||||
|
[XmlInclude(typeof(Feature))]
|
||||||
|
[XmlInclude(typeof(Info))]
|
||||||
|
[XmlInclude(typeof(Input))]
|
||||||
|
[XmlInclude(typeof(Instance))]
|
||||||
|
[XmlInclude(typeof(Location))]
|
||||||
|
[XmlInclude(typeof(Media))]
|
||||||
|
[XmlInclude(typeof(Part))]
|
||||||
|
[XmlInclude(typeof(PartFeature))]
|
||||||
|
[XmlInclude(typeof(Port))]
|
||||||
|
[XmlInclude(typeof(RamOption))]
|
||||||
|
[XmlInclude(typeof(Release))]
|
||||||
|
[XmlInclude(typeof(Rom))]
|
||||||
|
[XmlInclude(typeof(Sample))]
|
||||||
|
[XmlInclude(typeof(Setting))]
|
||||||
|
[XmlInclude(typeof(SharedFeature))]
|
||||||
|
[XmlInclude(typeof(Slot))]
|
||||||
|
[XmlInclude(typeof(SlotOption))]
|
||||||
|
[XmlInclude(typeof(SoftwareList))]
|
||||||
|
[XmlInclude(typeof(Sound))]
|
||||||
public abstract class DatItem : IEquatable<DatItem>, IComparable<DatItem>, ICloneable
|
public abstract class DatItem : IEquatable<DatItem>, IComparable<DatItem>, ICloneable
|
||||||
{
|
{
|
||||||
#region Fields
|
#region Fields
|
||||||
@@ -28,12 +67,14 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("type")]
|
[JsonProperty("type")]
|
||||||
[JsonConverter(typeof(StringEnumConverter))]
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
[XmlAttribute("type")]
|
||||||
public ItemType ItemType { get; set; }
|
public ItemType ItemType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Duplicate type when compared to another item
|
/// Duplicate type when compared to another item
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
[XmlIgnore]
|
||||||
public DupeType DupeType { get; set; }
|
public DupeType DupeType { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -44,6 +85,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// Machine values
|
/// Machine values
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
[XmlIgnore]
|
||||||
public Machine Machine { get; set; } = new Machine();
|
public Machine Machine { get; set; } = new Machine();
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -54,12 +96,14 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// Source information
|
/// Source information
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
[XmlIgnore]
|
||||||
public Source Source { get; set; } = new Source();
|
public Source Source { get; set; } = new Source();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Flag if item should be removed
|
/// Flag if item should be removed
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
[XmlIgnore]
|
||||||
public bool Remove { get; set; }
|
public bool Remove { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
using SabreTools.Library.Filtering;
|
using SabreTools.Library.Filtering;
|
||||||
using SabreTools.Library.Tools;
|
using SabreTools.Library.Tools;
|
||||||
@@ -13,6 +14,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// Represents the information specific to a set/game/machine
|
/// Represents the information specific to a set/game/machine
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonObject("machine")]
|
[JsonObject("machine")]
|
||||||
|
[XmlRoot("machine")]
|
||||||
public class Machine : ICloneable
|
public class Machine : ICloneable
|
||||||
{
|
{
|
||||||
#region Fields
|
#region Fields
|
||||||
@@ -23,6 +25,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// Name of the machine
|
/// Name of the machine
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("name", DefaultValueHandling = DefaultValueHandling.Include)]
|
[JsonProperty("name", DefaultValueHandling = DefaultValueHandling.Include)]
|
||||||
|
[XmlAttribute("name")]
|
||||||
public string Name { get; set; } = null;
|
public string Name { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -30,54 +33,63 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>Known as "Extra" in AttractMode</remarks>
|
/// <remarks>Known as "Extra" in AttractMode</remarks>
|
||||||
[JsonProperty("comment", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("comment", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("comment")]
|
||||||
public string Comment { get; set; } = null;
|
public string Comment { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Extended description
|
/// Extended description
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("description", DefaultValueHandling = DefaultValueHandling.Include)]
|
[JsonProperty("description", DefaultValueHandling = DefaultValueHandling.Include)]
|
||||||
|
[XmlElement("description")]
|
||||||
public string Description { get; set; } = null;
|
public string Description { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Year(s) of release/manufacture
|
/// Year(s) of release/manufacture
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("year", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("year", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("year")]
|
||||||
public string Year { get; set; } = null;
|
public string Year { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Manufacturer, if available
|
/// Manufacturer, if available
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("manufacturer", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("manufacturer", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("manufacturer")]
|
||||||
public string Manufacturer { get; set; } = null;
|
public string Manufacturer { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Publisher, if available
|
/// Publisher, if available
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("publisher", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("publisher", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("publisher")]
|
||||||
public string Publisher { get; set; } = null;
|
public string Publisher { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Category, if available
|
/// Category, if available
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("category", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("category", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("category")]
|
||||||
public string Category { get; set; } = null;
|
public string Category { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// fomof parent
|
/// fomof parent
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("romof", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("romof", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlAttribute("romof")]
|
||||||
public string RomOf { get; set; } = null;
|
public string RomOf { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// cloneof parent
|
/// cloneof parent
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("cloneof", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("cloneof", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlAttribute("cloneof")]
|
||||||
public string CloneOf { get; set; } = null;
|
public string CloneOf { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// sampleof parent
|
/// sampleof parent
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("sampleof", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("sampleof", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlAttribute("sampleof")]
|
||||||
public string SampleOf { get; set; } = null;
|
public string SampleOf { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -85,6 +97,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("type", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("type", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[JsonConverter(typeof(StringEnumConverter))]
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
[XmlAttribute("type")]
|
||||||
public MachineType MachineType { get; set; } = 0x0;
|
public MachineType MachineType { get; set; } = 0x0;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -96,42 +109,49 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>Also in Logiqx EmuArc</remarks>
|
/// <remarks>Also in Logiqx EmuArc</remarks>
|
||||||
[JsonProperty("players", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("players", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("players")]
|
||||||
public string Players { get; set; } = null;
|
public string Players { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Screen rotation
|
/// Screen rotation
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("rotation", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("rotation", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("rotation")]
|
||||||
public string Rotation { get; set; } = null;
|
public string Rotation { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Control method
|
/// Control method
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("control", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("control", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("control")]
|
||||||
public string Control { get; set; } = null;
|
public string Control { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Support status
|
/// Support status
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("status", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("status", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("status")]
|
||||||
public string Status { get; set; } = null;
|
public string Status { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Display count
|
/// Display count
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("displaycount", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("displaycount", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("displaycount")]
|
||||||
public string DisplayCount { get; set; } = null;
|
public string DisplayCount { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Display type
|
/// Display type
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("displaytype", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("displaytype", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("displaytype")]
|
||||||
public string DisplayType { get; set; } = null;
|
public string DisplayType { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of input buttons
|
/// Number of input buttons
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("buttons", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("buttons", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("buttons")]
|
||||||
public string Buttons { get; set; } = null;
|
public string Buttons { get; set; } = null;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -143,6 +163,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>Also in Logiqx</remarks>
|
/// <remarks>Also in Logiqx</remarks>
|
||||||
[JsonProperty("sourcefile", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("sourcefile", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlAttribute("sourcefile")]
|
||||||
public string SourceFile { get; set; } = null;
|
public string SourceFile { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -150,6 +171,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>Also in Logiqx</remarks>
|
/// <remarks>Also in Logiqx</remarks>
|
||||||
[JsonProperty("runnable", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("runnable", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlAttribute("runnable")]
|
||||||
public Runnable Runnable { get; set; } = Runnable.NULL;
|
public Runnable Runnable { get; set; } = Runnable.NULL;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -160,12 +182,14 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// Machine board name
|
/// Machine board name
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("board", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("board", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlAttribute("board")]
|
||||||
public string Board { get; set; } = null;
|
public string Board { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Rebuild location if different than machine name
|
/// Rebuild location if different than machine name
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("rebuildto", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("rebuildto", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlAttribute("rebuildto")]
|
||||||
public string RebuildTo { get; set; } = null;
|
public string RebuildTo { get; set; } = null;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -177,54 +201,63 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// Title ID
|
/// Title ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("titleid", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("titleid", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("titleid")]
|
||||||
public string TitleID { get; set; } = null;
|
public string TitleID { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Machine developer
|
/// Machine developer
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("developer", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("developer", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("developer")]
|
||||||
public string Developer { get; set; } = null;
|
public string Developer { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Game genre
|
/// Game genre
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("genre", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("genre", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("genre")]
|
||||||
public string Genre { get; set; } = null;
|
public string Genre { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Game subgenre
|
/// Game subgenre
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("subgenre", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("subgenre", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("subgenre")]
|
||||||
public string Subgenre { get; set; } = null;
|
public string Subgenre { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Game ratings
|
/// Game ratings
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("ratings", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("ratings", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("ratings")]
|
||||||
public string Ratings { get; set; } = null;
|
public string Ratings { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Game score
|
/// Game score
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("score", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("score", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("score")]
|
||||||
public string Score { get; set; } = null;
|
public string Score { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Is the machine enabled
|
/// Is the machine enabled
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("enabled", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("enabled", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("enabled")]
|
||||||
public string Enabled { get; set; } = null; // bool?
|
public string Enabled { get; set; } = null; // bool?
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Does the game have a CRC check
|
/// Does the game have a CRC check
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("hascrc", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("hascrc", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("hascrc")]
|
||||||
public bool? Crc { get; set; } = null;
|
public bool? Crc { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Machine relations
|
/// Machine relations
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("relatedto", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("relatedto", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("relatedto")]
|
||||||
public string RelatedTo { get; set; } = null;
|
public string RelatedTo { get; set; } = null;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -235,18 +268,21 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// Generation MSX ID
|
/// Generation MSX ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("genmsxid", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("genmsxid", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("genmsxid")]
|
||||||
public string GenMSXID { get; set; } = null;
|
public string GenMSXID { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// MSX System
|
/// MSX System
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("system", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("system", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("system")]
|
||||||
public string System { get; set; } = null;
|
public string System { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Machine country of origin
|
/// Machine country of origin
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("country", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("country", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("country")]
|
||||||
public string Country { get; set; } = null;
|
public string Country { get; set; } = null;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -257,10 +293,43 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// Support status
|
/// Support status
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("supported", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("supported", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("supported")]
|
||||||
public Supported Supported { get; set; } = Supported.NULL;
|
public Supported Supported { get; set; } = Supported.NULL;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region XML Serialization Nullable Specifications
|
||||||
|
|
||||||
|
#region Common
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool MachineTypeSpecified { get { return MachineType != 0x0 && MachineType != MachineType.NULL; } }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region ListXML
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool RunnableSpecified { get { return Runnable != Runnable.NULL; } }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Logiqx EmuArc Fields
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool CrcSpecified { get { return Crc != null; } }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region SoftwareList
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool SupportedSpecified { get { return Supported != Supported.NULL; } }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion // XML Serialization Nullable Specifications
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Accessors
|
#region Accessors
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
using SabreTools.Library.Data;
|
using SabreTools.Library.Data;
|
||||||
using SabreTools.Library.FileTypes;
|
using SabreTools.Library.FileTypes;
|
||||||
@@ -17,6 +18,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// Represents a generic file within a set
|
/// Represents a generic file within a set
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonObject("rom")]
|
[JsonObject("rom")]
|
||||||
|
[XmlRoot("rom")]
|
||||||
public class Rom : DatItem
|
public class Rom : DatItem
|
||||||
{
|
{
|
||||||
#region Private instance variables
|
#region Private instance variables
|
||||||
@@ -42,24 +44,28 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// Name of the item
|
/// Name of the item
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("name")]
|
[JsonProperty("name")]
|
||||||
|
[XmlAttribute("name")]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// What BIOS is required for this rom
|
/// What BIOS is required for this rom
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("bios", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("bios", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("bios")]
|
||||||
public string Bios { get; set; }
|
public string Bios { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Byte size of the rom
|
/// Byte size of the rom
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("size", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("size", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("size")]
|
||||||
public long? Size { get; set; }
|
public long? Size { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// File CRC32 hash
|
/// File CRC32 hash
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("crc", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("crc", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("crc")]
|
||||||
public string CRC
|
public string CRC
|
||||||
{
|
{
|
||||||
get { return _crc.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_crc); }
|
get { return _crc.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_crc); }
|
||||||
@@ -70,6 +76,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// File MD5 hash
|
/// File MD5 hash
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("md5", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("md5", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("md5")]
|
||||||
public string MD5
|
public string MD5
|
||||||
{
|
{
|
||||||
get { return _md5.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_md5); }
|
get { return _md5.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_md5); }
|
||||||
@@ -81,6 +88,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// File RIPEMD160 hash
|
/// File RIPEMD160 hash
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("ripemd160", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("ripemd160", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("ripemd160")]
|
||||||
public string RIPEMD160
|
public string RIPEMD160
|
||||||
{
|
{
|
||||||
get { return _ripemd160.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_ripemd160); }
|
get { return _ripemd160.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_ripemd160); }
|
||||||
@@ -92,6 +100,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// File SHA-1 hash
|
/// File SHA-1 hash
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("sha1", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("sha1", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("sha1")]
|
||||||
public string SHA1
|
public string SHA1
|
||||||
{
|
{
|
||||||
get { return _sha1.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_sha1); }
|
get { return _sha1.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_sha1); }
|
||||||
@@ -102,6 +111,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// File SHA-256 hash
|
/// File SHA-256 hash
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("sha256", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("sha256", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("sha256")]
|
||||||
public string SHA256
|
public string SHA256
|
||||||
{
|
{
|
||||||
get { return _sha256.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_sha256); }
|
get { return _sha256.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_sha256); }
|
||||||
@@ -112,6 +122,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// File SHA-384 hash
|
/// File SHA-384 hash
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("sha384", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("sha384", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("sha384")]
|
||||||
public string SHA384
|
public string SHA384
|
||||||
{
|
{
|
||||||
get { return _sha384.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_sha384); }
|
get { return _sha384.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_sha384); }
|
||||||
@@ -122,6 +133,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// File SHA-512 hash
|
/// File SHA-512 hash
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("sha512", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("sha512", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("sha512")]
|
||||||
public string SHA512
|
public string SHA512
|
||||||
{
|
{
|
||||||
get { return _sha512.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_sha512); }
|
get { return _sha512.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_sha512); }
|
||||||
@@ -132,6 +144,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// File SpamSum fuzzy hash
|
/// File SpamSum fuzzy hash
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("spamsum", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("spamsum", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("spamsum")]
|
||||||
public string SpamSum
|
public string SpamSum
|
||||||
{
|
{
|
||||||
get { return _spamsum.IsNullOrEmpty() ? null : Encoding.UTF8.GetString(_spamsum); }
|
get { return _spamsum.IsNullOrEmpty() ? null : Encoding.UTF8.GetString(_spamsum); }
|
||||||
@@ -142,24 +155,28 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// Rom name to merge from parent
|
/// Rom name to merge from parent
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("merge", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("merge", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("merge")]
|
||||||
public string MergeTag { get; set; }
|
public string MergeTag { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Rom region
|
/// Rom region
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("region", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("region", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("biregionos")]
|
||||||
public string Region { get; set; }
|
public string Region { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Data offset within rom
|
/// Data offset within rom
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("offset", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("offset", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("offset")]
|
||||||
public string Offset { get; set; }
|
public string Offset { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// File created date
|
/// File created date
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("date", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("date", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("date")]
|
||||||
public string Date { get; set; }
|
public string Date { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -167,18 +184,21 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("status", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("status", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
[JsonConverter(typeof(StringEnumConverter))]
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
[XmlElement("status")]
|
||||||
public ItemStatus ItemStatus { get; set; }
|
public ItemStatus ItemStatus { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determine if the rom is optional in the set
|
/// Determine if the rom is optional in the set
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("optional", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("optional", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("optional")]
|
||||||
public bool? Optional { get; set; }
|
public bool? Optional { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determine if the CRC32 hash is inverted
|
/// Determine if the CRC32 hash is inverted
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("inverted", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("inverted", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("inverted")]
|
||||||
public bool? Inverted { get; set; }
|
public bool? Inverted { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -189,12 +209,14 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// Alternate name for the item
|
/// Alternate name for the item
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("alt_romname", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("alt_romname", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("alt_romname")]
|
||||||
public string AltName { get; set; }
|
public string AltName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Alternate title for the item
|
/// Alternate title for the item
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("alt_title", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("alt_title", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("alt_title")]
|
||||||
public string AltTitle { get; set; }
|
public string AltTitle { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -205,12 +227,14 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// OpenMSX sub item type
|
/// OpenMSX sub item type
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("original", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("original", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("original")]
|
||||||
public Original Original { get; set; }
|
public Original Original { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// OpenMSX sub item type
|
/// OpenMSX sub item type
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("openmsx_subtype", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("openmsx_subtype", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("openmsx_subtype")]
|
||||||
[JsonConverter(typeof(StringEnumConverter))]
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
public OpenMSXSubType OpenMSXSubType { get; set; }
|
public OpenMSXSubType OpenMSXSubType { get; set; }
|
||||||
|
|
||||||
@@ -219,18 +243,21 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>Not related to the subtype above</remarks>
|
/// <remarks>Not related to the subtype above</remarks>
|
||||||
[JsonProperty("openmsx_type", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("openmsx_type", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("openmsx_type")]
|
||||||
public string OpenMSXType { get; set; }
|
public string OpenMSXType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Item remark (like a comment)
|
/// Item remark (like a comment)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("remark", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("remark", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("remark")]
|
||||||
public string Remark { get; set; }
|
public string Remark { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Boot state
|
/// Boot state
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("boot", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("boot", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("boot")]
|
||||||
public string Boot { get; set; }
|
public string Boot { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -241,12 +268,14 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// Data area information
|
/// Data area information
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("dataarea", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("dataarea", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("dataarea")]
|
||||||
public DataArea DataArea { get; set; }
|
public DataArea DataArea { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loading flag
|
/// Loading flag
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("loadflag", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("loadflag", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("loadflag")]
|
||||||
[JsonConverter(typeof(StringEnumConverter))]
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
public LoadFlag LoadFlag { get; set; }
|
public LoadFlag LoadFlag { get; set; }
|
||||||
|
|
||||||
@@ -254,16 +283,61 @@ namespace SabreTools.Library.DatItems
|
|||||||
/// Original hardware part associated with the item
|
/// Original hardware part associated with the item
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("part", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("part", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("part")]
|
||||||
public Part Part { get; set; }
|
public Part Part { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// SoftwareList value associated with the item
|
/// SoftwareList value associated with the item
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("value", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("value", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[XmlElement("value")]
|
||||||
public string Value { get; set; }
|
public string Value { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region XML Serialization Nullable Specifications
|
||||||
|
|
||||||
|
#region Common
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool SizeSpecified { get { return Size != null; } }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool ItemStatusSpecified { get { return ItemStatus != ItemStatus.NULL && ItemStatus != ItemStatus.None; } }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool OptionalSpecified { get { return Optional != null; } }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool InvertedSpecified { get { return Inverted != null; } }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region OpenMSX
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool OriginalSpecified { get { return Original != null && Original != default; } }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool OpenMSXSubTypeSpecified { get { return OpenMSXSubType != OpenMSXSubType.NULL; } }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region SoftwareList
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool DataAreaSpecified { get { return DataArea != null && DataArea != default; } }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool LoadFlagSpecified { get { return LoadFlag != LoadFlag.NULL; } }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool PartSpecified { get { return Part != null && Part != default; } }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion // XML Serialization Nullable Specifications
|
||||||
|
|
||||||
#endregion // Fields
|
#endregion // Fields
|
||||||
|
|
||||||
#region Accessors
|
#region Accessors
|
||||||
|
|||||||
Reference in New Issue
Block a user