mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Make items XML serializable
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -12,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents which Adjuster(s) is associated with a set
|
||||
/// </summary>
|
||||
[JsonObject("adjuster")]
|
||||
[XmlRoot("adjuster")]
|
||||
public class Adjuster : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -20,20 +22,29 @@ namespace SabreTools.Library.DatItems
|
||||
/// Name of the item
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Determine whether the value is default
|
||||
/// </summary>
|
||||
[JsonProperty("default", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("default")]
|
||||
public bool? Default { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool DefaultSpecified { get { return Default != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Conditions associated with the adjustment
|
||||
/// </summary>
|
||||
[JsonProperty("conditions", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("conditions")]
|
||||
public List<Condition> Conditions { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool ConditionsSpecified { get { return Conditions != null && Conditions.Count > 0; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Accessors
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using Newtonsoft.Json;
|
||||
@@ -10,6 +11,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents a single analog item
|
||||
/// </summary>
|
||||
[JsonObject("analog")]
|
||||
[XmlRoot("analog")]
|
||||
public class Analog : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -18,6 +20,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Analog mask value
|
||||
/// </summary>
|
||||
[JsonProperty("mask", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("mask")]
|
||||
public string Mask { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -12,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents generic archive files to be included in a set
|
||||
/// </summary>
|
||||
[JsonObject("archive")]
|
||||
[XmlRoot("archive")]
|
||||
public class Archive : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -20,6 +22,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Name of the item
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -12,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents which BIOS(es) is associated with a set
|
||||
/// </summary>
|
||||
[JsonObject("biosset")]
|
||||
[XmlRoot("biosset")]
|
||||
public class BiosSet : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -20,20 +22,26 @@ namespace SabreTools.Library.DatItems
|
||||
/// Name of the item
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Description of the BIOS
|
||||
/// </summary>
|
||||
[JsonProperty("description", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("description")]
|
||||
public string Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Determine whether the BIOS is default
|
||||
/// </summary>
|
||||
[JsonProperty("default", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("default")]
|
||||
public bool? Default { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool DefaultSpecified { get { return Default != null; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Accessors
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Library.DatItems
|
||||
{
|
||||
@@ -6,6 +8,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents a blank set from an input DAT
|
||||
/// </summary>
|
||||
[JsonObject("blank")]
|
||||
[XmlRoot("blank")]
|
||||
public class Blank : DatItem
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -14,6 +15,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents which Chip(s) is associated with a set
|
||||
/// </summary>
|
||||
[JsonObject("chip")]
|
||||
[XmlRoot("chip")]
|
||||
public class Chip : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -22,27 +24,37 @@ namespace SabreTools.Library.DatItems
|
||||
/// Name of the item
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Internal tag
|
||||
/// </summary>
|
||||
[JsonProperty("tag", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("tag")]
|
||||
public string Tag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Type of the chip
|
||||
/// </summary>
|
||||
[JsonProperty("chiptype", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[JsonProperty("type", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
[XmlElement("type")]
|
||||
public ChipType ChipType { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool ChipTypeSpecified { get { return ChipType != ChipType.NULL; } }
|
||||
|
||||
/// <summary>
|
||||
/// Clock speed
|
||||
/// </summary>
|
||||
[JsonProperty("clock", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("clock")]
|
||||
public long? Clock { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool ClockTypeSpecified { get { return Clock != null; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Accessors
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -12,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents a condition on a machine or other item
|
||||
/// </summary>
|
||||
[JsonObject("condition")]
|
||||
[XmlRoot("condition")]
|
||||
public class Condition : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -20,12 +22,14 @@ namespace SabreTools.Library.DatItems
|
||||
/// Condition tag value
|
||||
/// </summary>
|
||||
[JsonProperty("tag", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("tag")]
|
||||
public string Tag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Condition mask
|
||||
/// </summary>
|
||||
[JsonProperty("mask", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("mask")]
|
||||
public string Mask { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -33,12 +37,17 @@ namespace SabreTools.Library.DatItems
|
||||
/// </summary>
|
||||
[JsonProperty("relation", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
[XmlElement("relation")]
|
||||
public Relation Relation { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool RelationSpecified { get { return Relation != Relation.NULL; } }
|
||||
|
||||
/// <summary>
|
||||
/// Condition value
|
||||
/// </summary>
|
||||
[JsonProperty("value", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("value")]
|
||||
public string Value { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -12,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents which Configuration(s) is associated with a set
|
||||
/// </summary>
|
||||
[JsonObject("configuration")]
|
||||
[XmlRoot("configuration")]
|
||||
public class Configuration : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -20,38 +22,53 @@ namespace SabreTools.Library.DatItems
|
||||
/// Name of the item
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Tag associated with the configuration
|
||||
/// </summary>
|
||||
[JsonProperty("tag", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("tag")]
|
||||
public string Tag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Mask associated with the configuration
|
||||
/// </summary>
|
||||
[JsonProperty("mask", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("mask")]
|
||||
public string Mask { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Conditions associated with the configuration
|
||||
/// </summary>
|
||||
[JsonProperty("conditions", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("conditions")]
|
||||
public List<Condition> Conditions { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool ConditionsSpecified { get { return Conditions != null && Conditions.Count > 0; } }
|
||||
|
||||
/// <summary>
|
||||
/// Locations associated with the configuration
|
||||
/// </summary>
|
||||
[JsonProperty("locations", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("locations")]
|
||||
public List<Location> Locations { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool LocationsSpecified { get { return Locations != null && Locations.Count > 0; } }
|
||||
|
||||
/// <summary>
|
||||
/// Settings associated with the configuration
|
||||
/// </summary>
|
||||
[JsonProperty("settings", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("settings")]
|
||||
public List<Setting> Settings { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool SettingsSpecified { get { return Settings != null && Settings.Count > 0; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Accessors
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace SabreTools.Library.DatItems
|
||||
{
|
||||
@@ -12,6 +14,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents control for an input
|
||||
/// </summary>
|
||||
[JsonObject("control")]
|
||||
[XmlRoot("control")]
|
||||
public class Control : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -20,56 +23,93 @@ namespace SabreTools.Library.DatItems
|
||||
/// General type of input
|
||||
/// </summary>
|
||||
[JsonProperty("type", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
[XmlElement("type")]
|
||||
public ControlType ControlType { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool ControlTypeSpecified { get { return ControlType != ControlType.NULL; } }
|
||||
|
||||
/// <summary>
|
||||
/// Player which the input belongs to
|
||||
/// </summary>
|
||||
[JsonProperty("player", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("player")]
|
||||
public long? Player { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool PlayerSpecified { get { return Player != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Total number of buttons
|
||||
/// </summary>
|
||||
[JsonProperty("buttons", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("buttons")]
|
||||
public long? Buttons { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool ButtonsSpecified { get { return Buttons != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Total number of non-optional buttons
|
||||
/// </summary>
|
||||
[JsonProperty("reqbuttons", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("reqbuttons")]
|
||||
public long? RequiredButtons { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool RequiredButtonsSpecified { get { return RequiredButtons != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Analog minimum value
|
||||
/// </summary>
|
||||
[JsonProperty("minimum", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("minimum")]
|
||||
public long? Minimum { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool MinimumSpecified { get { return Minimum != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Analog maximum value
|
||||
/// </summary>
|
||||
[JsonProperty("maximum", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("maximum")]
|
||||
public long? Maximum { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool MaximumSpecified { get { return Maximum != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Default analog sensitivity
|
||||
/// </summary>
|
||||
[JsonProperty("sensitivity", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("sensitivity")]
|
||||
public long? Sensitivity { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool SensitivitySpecified { get { return Sensitivity != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Default analog keydelta
|
||||
/// </summary>
|
||||
[JsonProperty("keydelta", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("keydelta")]
|
||||
public long? KeyDelta { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool KeyDeltaSpecified { get { return KeyDelta != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Default analog reverse setting
|
||||
/// </summary>
|
||||
[JsonProperty("reverse", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("type")]
|
||||
public bool? Reverse { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool ReverseSpecified { get { return Reverse != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// First set of ways
|
||||
/// </summary>
|
||||
@@ -80,12 +120,14 @@ namespace SabreTools.Library.DatItems
|
||||
/// Second set of ways
|
||||
/// </summary>
|
||||
[JsonProperty("ways2", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("type")]
|
||||
public string Ways2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Third set of ways
|
||||
/// </summary>
|
||||
[JsonProperty("ways3", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("type")]
|
||||
public string Ways3 { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -65,9 +65,9 @@ namespace SabreTools.Library.DatItems
|
||||
/// <summary>
|
||||
/// Item type for outputting
|
||||
/// </summary>
|
||||
[JsonProperty("type")]
|
||||
[JsonProperty("itemtype")]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
[XmlAttribute("type")]
|
||||
[XmlElement("itemtype")]
|
||||
public ItemType ItemType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -14,6 +15,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// </summary>
|
||||
/// <remarks>One DataArea can contain multiple Rom items</remarks>
|
||||
[JsonObject("dataarea")]
|
||||
[XmlRoot("dataarea")]
|
||||
public class DataArea : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -22,26 +24,39 @@ namespace SabreTools.Library.DatItems
|
||||
/// Name of the item
|
||||
/// </summary>
|
||||
[JsonProperty("name", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Total size of the area
|
||||
/// </summary>
|
||||
[JsonProperty("size", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("size")]
|
||||
public long? Size { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool SizeSpecified { get { return Size != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Word width for the area
|
||||
/// </summary>
|
||||
[JsonProperty("width", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("width")]
|
||||
public long? Width { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool WidthSpecified { get { return Width != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Byte endianness of the area
|
||||
/// </summary>
|
||||
[JsonProperty("endianness", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("endianness")]
|
||||
public Endianness Endianness { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool EndiannessSpecified { get { return Endianness != Endianness.NULL; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Accessors
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace SabreTools.Library.DatItems
|
||||
{
|
||||
@@ -11,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents a single device on the machine
|
||||
/// </summary>
|
||||
[JsonObject("device")]
|
||||
[XmlRoot("device")]
|
||||
public class Device : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -19,18 +22,25 @@ namespace SabreTools.Library.DatItems
|
||||
/// Device type
|
||||
/// </summary>
|
||||
[JsonProperty("type", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
[XmlElement("type")]
|
||||
public DeviceType DeviceType { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool DeviceTypeSpecified { get { return DeviceType != DeviceType.NULL; } }
|
||||
|
||||
/// <summary>
|
||||
/// Device tag
|
||||
/// </summary>
|
||||
[JsonProperty("tag", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("tag")]
|
||||
public string Tag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fixed image format
|
||||
/// </summary>
|
||||
[JsonProperty("fixed_image", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("fixed_image")]
|
||||
public string FixedImage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -38,26 +48,39 @@ namespace SabreTools.Library.DatItems
|
||||
/// </summary>
|
||||
/// <remarks>Only value used seems to be 1. Used like bool, but actually int</remarks>
|
||||
[JsonProperty("mandatory", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("mandatory")]
|
||||
public long? Mandatory { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool MandatorySpecified { get { return Mandatory != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Device interface
|
||||
/// </summary>
|
||||
[JsonProperty("interface", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("interface")]
|
||||
public string Interface { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Device instances
|
||||
/// </summary>
|
||||
[JsonProperty("instances", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("instances")]
|
||||
public List<Instance> Instances { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool InstancesSpecified { get { return Instances != null && Instances.Count > 0; } }
|
||||
|
||||
/// <summary>
|
||||
/// Device extensions
|
||||
/// </summary>
|
||||
[JsonProperty("extensions", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("extensions")]
|
||||
public List<Extension> Extensions { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool ExtensionsSpecified { get { return Extensions != null && Extensions.Count > 0; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Accessors
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -12,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents which Device Reference(s) is associated with a set
|
||||
/// </summary>
|
||||
[JsonObject("device_ref")]
|
||||
[XmlRoot("device_ref")]
|
||||
public class DeviceReference : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -20,6 +22,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Name of the item
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -12,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents which DIP Switch(es) is associated with a set
|
||||
/// </summary>
|
||||
[JsonObject("dipswitch")]
|
||||
[XmlRoot("dipswitch")]
|
||||
public class DipSwitch : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -22,38 +24,53 @@ namespace SabreTools.Library.DatItems
|
||||
/// Name of the item
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Tag associated with the dipswitch
|
||||
/// </summary>
|
||||
[JsonProperty("tag", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("tag")]
|
||||
public string Tag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Mask associated with the dipswitch
|
||||
/// </summary>
|
||||
[JsonProperty("mask", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("mask")]
|
||||
public string Mask { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Conditions associated with the dipswitch
|
||||
/// </summary>
|
||||
[JsonProperty("conditions", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("conditions")]
|
||||
public List<Condition> Conditions { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool ConditionsSpecified { get { return Conditions != null && Conditions.Count > 0; } }
|
||||
|
||||
/// <summary>
|
||||
/// Locations associated with the dipswitch
|
||||
/// </summary>
|
||||
[JsonProperty("locations", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("locations")]
|
||||
public List<Location> Locations { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool LocationsSpecified { get { return Locations != null && Locations.Count > 0; } }
|
||||
|
||||
/// <summary>
|
||||
/// Settings associated with the dipswitch
|
||||
/// </summary>
|
||||
[JsonProperty("values", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("values")]
|
||||
public List<Setting> Values { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool ValuesSpecified { get { return Values != null && Values.Count > 0; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region SoftwareList
|
||||
@@ -62,8 +79,20 @@ namespace SabreTools.Library.DatItems
|
||||
/// Original hardware part associated with the item
|
||||
/// </summary>
|
||||
[JsonProperty("part", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("part")]
|
||||
public Part Part { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool PartSpecified
|
||||
{
|
||||
get
|
||||
{
|
||||
return Part != null && Part != default
|
||||
&& ((Part.Name != null && Part.Name != default)
|
||||
|| (Part.Interface != null && Part.Interface != default));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.FileTypes;
|
||||
using SabreTools.Library.Filtering;
|
||||
@@ -14,6 +15,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents Compressed Hunks of Data (CHD) formatted disks which use internal hashes
|
||||
/// </summary>
|
||||
[JsonObject("disk")]
|
||||
[XmlRoot("disk")]
|
||||
public class Disk : DatItem
|
||||
{
|
||||
#region Private instance variables
|
||||
@@ -31,12 +33,14 @@ namespace SabreTools.Library.DatItems
|
||||
/// Name of the item
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Data MD5 hash
|
||||
/// </summary>
|
||||
[JsonProperty("md5", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("md5")]
|
||||
public string MD5
|
||||
{
|
||||
get { return _md5.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_md5); }
|
||||
@@ -47,6 +51,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Data SHA-1 hash
|
||||
/// </summary>
|
||||
[JsonProperty("sha1", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("sha1")]
|
||||
public string SHA1
|
||||
{
|
||||
get { return _sha1.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_sha1); }
|
||||
@@ -57,39 +62,54 @@ namespace SabreTools.Library.DatItems
|
||||
/// Disk name to merge from parent
|
||||
/// </summary>
|
||||
[JsonProperty("merge", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("merge")]
|
||||
public string MergeTag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Disk region
|
||||
/// </summary>
|
||||
[JsonProperty("region", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("region")]
|
||||
public string Region { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Disk index
|
||||
/// </summary>
|
||||
[JsonProperty("index", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("index")]
|
||||
public string Index { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Disk writable flag
|
||||
/// </summary>
|
||||
[JsonProperty("writable", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("writable")]
|
||||
public bool? Writable { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool WritableSpecified { get { return Writable != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Disk dump status
|
||||
/// </summary>
|
||||
[JsonProperty("status", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
[XmlElement("status")]
|
||||
public ItemStatus ItemStatus { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool ItemStatusSpecified { get { return ItemStatus != ItemStatus.NULL; } }
|
||||
|
||||
/// <summary>
|
||||
/// Determine if the disk is optional in the set
|
||||
/// </summary>
|
||||
[JsonProperty("optional", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("optional")]
|
||||
public bool? Optional { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool OptionalSpecified { get { return Optional != null; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region SoftwareList
|
||||
@@ -98,14 +118,37 @@ namespace SabreTools.Library.DatItems
|
||||
/// Disk area information
|
||||
/// </summary>
|
||||
[JsonProperty("diskarea", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("diskarea")]
|
||||
public DiskArea DiskArea { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool DiskAreaSpecified
|
||||
{
|
||||
get
|
||||
{
|
||||
return DiskArea != null && DiskArea != default
|
||||
&& DiskArea.Name != null && DiskArea.Name != default;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Original hardware part associated with the item
|
||||
/// </summary>
|
||||
[JsonProperty("part", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("part")]
|
||||
public Part Part { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool PartSpecified
|
||||
{
|
||||
get
|
||||
{
|
||||
return Part != null && Part != default
|
||||
&& ((Part.Name != null && Part.Name != default)
|
||||
|| (Part.Interface != null && Part.Interface != default));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -14,6 +15,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// </summary>
|
||||
/// <remarks>One DiskArea can contain multiple Disk items</remarks>
|
||||
[JsonObject("diskarea")]
|
||||
[XmlRoot("diskarea")]
|
||||
public class DiskArea : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -22,6 +24,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Name of the item
|
||||
/// </summary>
|
||||
[JsonProperty("name", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -13,6 +14,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents one machine display
|
||||
/// </summary>
|
||||
[JsonObject("display")]
|
||||
[XmlRoot("display")]
|
||||
public class Display : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -21,6 +23,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Display tag
|
||||
/// </summary>
|
||||
[JsonProperty("tag", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("tag")]
|
||||
public string Tag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -28,80 +31,132 @@ namespace SabreTools.Library.DatItems
|
||||
/// </summary>
|
||||
[JsonProperty("type", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
[XmlElement("type")]
|
||||
public DisplayType DisplayType { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool DisplayTypeSpecified { get { return DisplayType != DisplayType.NULL; } }
|
||||
|
||||
/// <summary>
|
||||
/// Display rotation
|
||||
/// </summary>
|
||||
[JsonProperty("rotate", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("rotate")]
|
||||
public long? Rotate { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool RotateSpecified { get { return Rotate != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Determines if display is flipped in the X-coordinates
|
||||
/// </summary>
|
||||
[JsonProperty("flipx", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("flipx")]
|
||||
public bool? FlipX { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool FlipXSpecified { get { return FlipX != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Display width
|
||||
/// </summary>
|
||||
[JsonProperty("width", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("width")]
|
||||
public long? Width { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool WidthSpecified { get { return Width != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Display height
|
||||
/// </summary>
|
||||
[JsonProperty("height", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("height")]
|
||||
public long? Height { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool HeightSpecified { get { return Height != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Refresh rate
|
||||
/// </summary>
|
||||
[JsonProperty("refresh", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("refresh")]
|
||||
public double? Refresh { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool RefreshSpecified { get { return Refresh != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Pixel clock timer
|
||||
/// </summary>
|
||||
[JsonProperty("pixclock", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("pixclock")]
|
||||
public long? PixClock { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool PixClockSpecified { get { return PixClock != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Total horizontal lines
|
||||
/// </summary>
|
||||
[JsonProperty("htotal", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("htotal")]
|
||||
public long? HTotal { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool HTotalSpecified { get { return HTotal != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Horizontal blank end
|
||||
/// </summary>
|
||||
[JsonProperty("hbend", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("hbend")]
|
||||
public long? HBEnd { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool HBEndSpecified { get { return HBEnd != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Horizontal blank start
|
||||
/// </summary>
|
||||
[JsonProperty("hbstart", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("hbstart")]
|
||||
public long? HBStart { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool HBStartSpecified { get { return HBStart != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Total vertical lines
|
||||
/// </summary>
|
||||
[JsonProperty("vtotal", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("vtotal")]
|
||||
public long? VTotal { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool VTotalSpecified { get { return VTotal != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Vertical blank end
|
||||
/// </summary>
|
||||
[JsonProperty("vbend", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("vbend")]
|
||||
public long? VBEnd { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool VBEndSpecified { get { return VBEnd != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Vertical blank start
|
||||
/// </summary>
|
||||
[JsonProperty("vbstart", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("vbstart")]
|
||||
public long? VBStart { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool VBStartSpecified { get { return VBStart != null; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Accessors
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -12,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents the a driver of the machine
|
||||
/// </summary>
|
||||
[JsonObject("driver")]
|
||||
[XmlRoot("driver")]
|
||||
public class Driver : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -21,29 +23,45 @@ namespace SabreTools.Library.DatItems
|
||||
/// </summary>
|
||||
[JsonProperty("status", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
[XmlElement("status")]
|
||||
public SupportStatus Status { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool StatusSpecified { get { return Status != SupportStatus.NULL; } }
|
||||
|
||||
/// <summary>
|
||||
/// Driver emulation status
|
||||
/// </summary>
|
||||
[JsonProperty("emulation", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
[XmlElement("emulation")]
|
||||
public SupportStatus Emulation { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool EmulationSpecified { get { return Emulation != SupportStatus.NULL; ; } }
|
||||
|
||||
/// <summary>
|
||||
/// Cocktail orientation status
|
||||
/// </summary>
|
||||
[JsonProperty("cocktail", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
[XmlElement("cocktail")]
|
||||
public SupportStatus Cocktail { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool CocktailSpecified { get { return Cocktail != SupportStatus.NULL; ; } }
|
||||
|
||||
/// <summary>
|
||||
/// Save state support status
|
||||
/// </summary>
|
||||
[JsonProperty("savestate", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
[XmlElement("savestate")]
|
||||
public Supported SaveState { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool SaveStateSpecified { get { return SaveState != Supported.NULL; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Accessors
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -12,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents a matchable extension
|
||||
/// </summary>
|
||||
[JsonObject("extension")]
|
||||
[XmlRoot("extension")]
|
||||
public class Extension : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -20,6 +22,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Name of the item
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -12,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents the a feature of the machine
|
||||
/// </summary>
|
||||
[JsonObject("feature")]
|
||||
[XmlRoot("feature")]
|
||||
public class Feature : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -21,22 +23,34 @@ namespace SabreTools.Library.DatItems
|
||||
/// </summary>
|
||||
[JsonProperty("type", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
[XmlElement("type")]
|
||||
public FeatureType Type { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool TypeSpecified { get { return Type != FeatureType.NULL; } }
|
||||
|
||||
/// <summary>
|
||||
/// Emulation status
|
||||
/// </summary>
|
||||
[JsonProperty("status", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
[XmlElement("status")]
|
||||
public FeatureStatus Status { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool StatusSpecified { get { return Status != FeatureStatus.NULL; } }
|
||||
|
||||
/// <summary>
|
||||
/// Overall status
|
||||
/// </summary>
|
||||
[JsonProperty("overall", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
[XmlElement("overall")]
|
||||
public FeatureStatus Overall { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool OverallSpecified { get { return Overall != FeatureStatus.NULL; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Accessors
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -12,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents special information about a machine
|
||||
/// </summary>
|
||||
[JsonObject("info")]
|
||||
[XmlRoot("info")]
|
||||
public class Info : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -20,12 +22,14 @@ namespace SabreTools.Library.DatItems
|
||||
/// Name of the item
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Information value
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
[XmlElement("value")]
|
||||
public string Value { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -12,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents one ListXML input
|
||||
/// </summary>
|
||||
[JsonObject("input")]
|
||||
[XmlRoot("input")]
|
||||
public class Input : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -20,32 +22,52 @@ namespace SabreTools.Library.DatItems
|
||||
/// Input service ID
|
||||
/// </summary>
|
||||
[JsonProperty("service", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("service")]
|
||||
public bool? Service { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool ServiceSpecified { get { return Service != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Determins if this has a tilt sensor
|
||||
/// </summary>
|
||||
[JsonProperty("tilt", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("tilt")]
|
||||
public bool? Tilt { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool TiltSpecified { get { return Tilt != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Number of players on the input
|
||||
/// </summary>
|
||||
[JsonProperty("players", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("players")]
|
||||
public long? Players { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool PlayersSpecified { get { return Players != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Number of coins required
|
||||
/// </summary>
|
||||
[JsonProperty("coins", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("coins")]
|
||||
public long? Coins { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool CoinsSpecified { get { return Coins != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Set of controls for the input
|
||||
/// </summary>
|
||||
[JsonProperty("controls", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("controls")]
|
||||
public List<Control> Controls { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool ControlsSpecified { get { return Controls != null && Controls.Count > 0; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Accessors
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -12,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents a single instance of another item
|
||||
/// </summary>
|
||||
[JsonObject("instance")]
|
||||
[XmlRoot("instance")]
|
||||
public class Instance : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -20,12 +22,14 @@ namespace SabreTools.Library.DatItems
|
||||
/// Name of the item
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Short name for the instance
|
||||
/// </summary>
|
||||
[JsonProperty("briefname", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("briefname")]
|
||||
public string BriefName { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -12,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents one conflocation or diplocation
|
||||
/// </summary>
|
||||
[JsonObject("location")]
|
||||
[XmlRoot("location")]
|
||||
public class Location : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -20,20 +22,29 @@ namespace SabreTools.Library.DatItems
|
||||
/// Location name
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Location ID
|
||||
/// </summary>
|
||||
[JsonProperty("number", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("number")]
|
||||
public long? Number { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool NumberSpecified { get { return Number != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Determines if location is inverted or not
|
||||
/// </summary>
|
||||
[JsonProperty("inverted", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("inverted")]
|
||||
public bool? Inverted { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool InvertedSpecified { get { return Inverted != null; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Accessors
|
||||
|
||||
@@ -19,13 +19,13 @@ namespace SabreTools.Library.DatItems
|
||||
{
|
||||
#region Fields
|
||||
|
||||
#region Common Fields
|
||||
#region Common
|
||||
|
||||
/// <summary>
|
||||
/// Name of the machine
|
||||
/// </summary>
|
||||
[JsonProperty("name", DefaultValueHandling = DefaultValueHandling.Include)]
|
||||
[XmlAttribute("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
@@ -75,21 +75,21 @@ namespace SabreTools.Library.DatItems
|
||||
/// fomof parent
|
||||
/// </summary>
|
||||
[JsonProperty("romof", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlAttribute("romof")]
|
||||
[XmlElement("romof")]
|
||||
public string RomOf { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// cloneof parent
|
||||
/// </summary>
|
||||
[JsonProperty("cloneof", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlAttribute("cloneof")]
|
||||
[XmlElement("cloneof")]
|
||||
public string CloneOf { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// sampleof parent
|
||||
/// </summary>
|
||||
[JsonProperty("sampleof", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlAttribute("sampleof")]
|
||||
[XmlElement("sampleof")]
|
||||
public string SampleOf { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
@@ -97,12 +97,15 @@ namespace SabreTools.Library.DatItems
|
||||
/// </summary>
|
||||
[JsonProperty("type", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
[XmlAttribute("type")]
|
||||
[XmlElement("type")]
|
||||
public MachineType MachineType { get; set; } = 0x0;
|
||||
|
||||
[JsonIgnore]
|
||||
public bool MachineTypeSpecified { get { return MachineType != 0x0 && MachineType != MachineType.NULL; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region AttractMode Fields
|
||||
#region AttractMode
|
||||
|
||||
/// <summary>
|
||||
/// Player count
|
||||
@@ -156,14 +159,14 @@ namespace SabreTools.Library.DatItems
|
||||
|
||||
#endregion
|
||||
|
||||
#region ListXML Fields
|
||||
#region ListXML
|
||||
|
||||
/// <summary>
|
||||
/// Emulator source file related to the machine
|
||||
/// </summary>
|
||||
/// <remarks>Also in Logiqx</remarks>
|
||||
[JsonProperty("sourcefile", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlAttribute("sourcefile")]
|
||||
[XmlElement("sourcefile")]
|
||||
public string SourceFile { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
@@ -171,31 +174,34 @@ namespace SabreTools.Library.DatItems
|
||||
/// </summary>
|
||||
/// <remarks>Also in Logiqx</remarks>
|
||||
[JsonProperty("runnable", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlAttribute("runnable")]
|
||||
[XmlElement("runnable")]
|
||||
public Runnable Runnable { get; set; } = Runnable.NULL;
|
||||
|
||||
[JsonIgnore]
|
||||
public bool RunnableSpecified { get { return Runnable != Runnable.NULL; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Logiqx Fields
|
||||
#region Logiqx
|
||||
|
||||
/// <summary>
|
||||
/// Machine board name
|
||||
/// </summary>
|
||||
[JsonProperty("board", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlAttribute("board")]
|
||||
[XmlElement("board")]
|
||||
public string Board { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Rebuild location if different than machine name
|
||||
/// </summary>
|
||||
[JsonProperty("rebuildto", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlAttribute("rebuildto")]
|
||||
[XmlElement("rebuildto")]
|
||||
public string RebuildTo { get; set; } = null;
|
||||
|
||||
#endregion
|
||||
|
||||
// TODO: Should this be a separate object for TruRip?
|
||||
#region Logiqx EmuArc Fields
|
||||
#region Logiqx EmuArc
|
||||
|
||||
/// <summary>
|
||||
/// Title ID
|
||||
@@ -253,6 +259,9 @@ namespace SabreTools.Library.DatItems
|
||||
[XmlElement("hascrc")]
|
||||
public bool? Crc { get; set; } = null;
|
||||
|
||||
[JsonIgnore]
|
||||
public bool CrcSpecified { get { return Crc != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Machine relations
|
||||
/// </summary>
|
||||
@@ -262,7 +271,7 @@ namespace SabreTools.Library.DatItems
|
||||
|
||||
#endregion
|
||||
|
||||
#region OpenMSX Fields
|
||||
#region OpenMSX
|
||||
|
||||
/// <summary>
|
||||
/// Generation MSX ID
|
||||
@@ -287,7 +296,7 @@ namespace SabreTools.Library.DatItems
|
||||
|
||||
#endregion
|
||||
|
||||
#region SoftwareList Fields
|
||||
#region SoftwareList
|
||||
|
||||
/// <summary>
|
||||
/// Support status
|
||||
@@ -296,41 +305,12 @@ namespace SabreTools.Library.DatItems
|
||||
[XmlElement("supported")]
|
||||
public Supported Supported { get; set; } = Supported.NULL;
|
||||
|
||||
#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 // Fields
|
||||
|
||||
#region Accessors
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.FileTypes;
|
||||
using SabreTools.Library.Filtering;
|
||||
@@ -14,6 +15,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents Aaruformat images which use internal hashes
|
||||
/// </summary>
|
||||
[JsonObject("media")]
|
||||
[XmlRoot("media")]
|
||||
public class Media : DatItem
|
||||
{
|
||||
#region Private instance variables
|
||||
@@ -31,12 +33,14 @@ namespace SabreTools.Library.DatItems
|
||||
/// Name of the item
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Data MD5 hash
|
||||
/// </summary>
|
||||
[JsonProperty("md5", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("md5")]
|
||||
public string MD5
|
||||
{
|
||||
get { return _md5.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_md5); }
|
||||
@@ -47,6 +51,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Data SHA-1 hash
|
||||
/// </summary>
|
||||
[JsonProperty("sha1", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("sha1")]
|
||||
public string SHA1
|
||||
{
|
||||
get { return _sha1.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_sha1); }
|
||||
@@ -57,6 +62,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Data SHA-256 hash
|
||||
/// </summary>
|
||||
[JsonProperty("sha256", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("sha256")]
|
||||
public string SHA256
|
||||
{
|
||||
get { return _sha256.IsNullOrEmpty() ? null : Utilities.ByteArrayToString(_sha256); }
|
||||
@@ -67,6 +73,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// File SpamSum fuzzy hash
|
||||
/// </summary>
|
||||
[JsonProperty("spamsum", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("spamsum")]
|
||||
public string SpamSum
|
||||
{
|
||||
get { return _spamsum.IsNullOrEmpty() ? null : Encoding.UTF8.GetString(_spamsum); }
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -14,19 +15,26 @@ namespace SabreTools.Library.DatItems
|
||||
/// </summary>
|
||||
/// <remarks>One Part can contain multiple PartFeature, DataArea, DiskArea, and DipSwitch items</remarks>
|
||||
[JsonObject("part")]
|
||||
[XmlRoot("part")]
|
||||
public class Part : DatItem
|
||||
{
|
||||
#region Fields
|
||||
|
||||
[JsonProperty("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonProperty("interface")]
|
||||
[XmlElement("interface")]
|
||||
public string Interface { get; set; }
|
||||
|
||||
[JsonProperty("features", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("features")]
|
||||
public List<PartFeature> Features { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool FeaturesSpecified { get { return Features != null && Features.Count > 0; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Accessors
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -12,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents one part feature object
|
||||
/// </summary>
|
||||
[JsonObject("part_feature")]
|
||||
[XmlRoot("part_feature")]
|
||||
public class PartFeature : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -20,12 +22,14 @@ namespace SabreTools.Library.DatItems
|
||||
/// Name of the item
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// PartFeature value
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
[XmlElement("value")]
|
||||
public string Value { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using Newtonsoft.Json;
|
||||
@@ -10,6 +11,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents a single port on a machine
|
||||
/// </summary>
|
||||
[JsonObject("port")]
|
||||
[XmlRoot("port")]
|
||||
public class Port : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -18,14 +20,19 @@ namespace SabreTools.Library.DatItems
|
||||
/// Tag for the port
|
||||
/// </summary>
|
||||
[JsonProperty("tag", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("tag")]
|
||||
public string Tag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// List of analogs on the port
|
||||
/// </summary>
|
||||
[JsonProperty("analogs", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("analogs")]
|
||||
public List<Analog> Analogs { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool AnalogsSpecified { get { return Analogs != null && Analogs.Count > 0; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Accessors
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -12,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents which RAM option(s) is associated with a set
|
||||
/// </summary>
|
||||
[JsonObject("ramoption")]
|
||||
[XmlRoot("ramoption")]
|
||||
public class RamOption : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -20,18 +22,24 @@ namespace SabreTools.Library.DatItems
|
||||
/// Name of the item
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Determine whether the RamOption is default
|
||||
/// </summary>
|
||||
[JsonProperty("default", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("default")]
|
||||
public bool? Default { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool DefaultSpecified { get { return Default != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Determines the content of the RamOption
|
||||
/// </summary>
|
||||
[JsonProperty("content", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("content")]
|
||||
public string Content { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -12,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents release information about a set
|
||||
/// </summary>
|
||||
[JsonObject("release")]
|
||||
[XmlRoot("release")]
|
||||
public class Release : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -20,32 +22,40 @@ namespace SabreTools.Library.DatItems
|
||||
/// Name of the item
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Release region(s)
|
||||
/// </summary>
|
||||
[JsonProperty("region", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("region")]
|
||||
public string Region { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Release language(s)
|
||||
/// </summary>
|
||||
[JsonProperty("language", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("language")]
|
||||
public string Language { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Date of release
|
||||
/// </summary>
|
||||
[JsonProperty("date", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("date")]
|
||||
public string Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Default release, if applicable
|
||||
/// </summary>
|
||||
[JsonProperty("default", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("default")]
|
||||
public bool? Default { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool DefaultSpecified { get { return Default != null; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Accessors
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Name of the item
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
[XmlAttribute("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -61,6 +61,9 @@ namespace SabreTools.Library.DatItems
|
||||
[XmlElement("size")]
|
||||
public long? Size { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool SizeSpecified { get { return Size != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// File CRC32 hash
|
||||
/// </summary>
|
||||
@@ -187,6 +190,9 @@ namespace SabreTools.Library.DatItems
|
||||
[XmlElement("status")]
|
||||
public ItemStatus ItemStatus { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool ItemStatusSpecified { get { return ItemStatus != ItemStatus.NULL && ItemStatus != ItemStatus.None; } }
|
||||
|
||||
/// <summary>
|
||||
/// Determine if the rom is optional in the set
|
||||
/// </summary>
|
||||
@@ -194,6 +200,9 @@ namespace SabreTools.Library.DatItems
|
||||
[XmlElement("optional")]
|
||||
public bool? Optional { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool OptionalSpecified { get { return Optional != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Determine if the CRC32 hash is inverted
|
||||
/// </summary>
|
||||
@@ -201,6 +210,9 @@ namespace SabreTools.Library.DatItems
|
||||
[XmlElement("inverted")]
|
||||
public bool? Inverted { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool InvertedSpecified { get { return Inverted != null; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region AttractMode
|
||||
@@ -230,6 +242,9 @@ namespace SabreTools.Library.DatItems
|
||||
[XmlElement("original")]
|
||||
public Original Original { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool OriginalSpecified { get { return Original != null && Original != default; } }
|
||||
|
||||
/// <summary>
|
||||
/// OpenMSX sub item type
|
||||
/// </summary>
|
||||
@@ -238,6 +253,9 @@ namespace SabreTools.Library.DatItems
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public OpenMSXSubType OpenMSXSubType { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool OpenMSXSubTypeSpecified { get { return OpenMSXSubType != OpenMSXSubType.NULL; } }
|
||||
|
||||
/// <summary>
|
||||
/// OpenMSX sub item type
|
||||
/// </summary>
|
||||
@@ -271,6 +289,19 @@ namespace SabreTools.Library.DatItems
|
||||
[XmlElement("dataarea")]
|
||||
public DataArea DataArea { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool DataAreaSpecified
|
||||
{
|
||||
get
|
||||
{
|
||||
return DataArea != null && DataArea != default
|
||||
&& ((DataArea.Name != null && DataArea.Name != default)
|
||||
|| (DataArea.Size != null && DataArea.Size != default)
|
||||
|| (DataArea.Width != null && DataArea.Width != default)
|
||||
|| (DataArea.Endianness != Endianness.NULL));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loading flag
|
||||
/// </summary>
|
||||
@@ -279,6 +310,9 @@ namespace SabreTools.Library.DatItems
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public LoadFlag LoadFlag { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool LoadFlagSpecified { get { return LoadFlag != LoadFlag.NULL; } }
|
||||
|
||||
/// <summary>
|
||||
/// Original hardware part associated with the item
|
||||
/// </summary>
|
||||
@@ -286,6 +320,17 @@ namespace SabreTools.Library.DatItems
|
||||
[XmlElement("part")]
|
||||
public Part Part { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool PartSpecified
|
||||
{
|
||||
get
|
||||
{
|
||||
return Part != null && Part != default
|
||||
&& ((Part.Name != null && Part.Name != default)
|
||||
|| (Part.Interface != null && Part.Interface != default));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// SoftwareList value associated with the item
|
||||
/// </summary>
|
||||
@@ -295,49 +340,6 @@ namespace SabreTools.Library.DatItems
|
||||
|
||||
#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
|
||||
|
||||
#region Accessors
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -12,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents a (usually WAV-formatted) sample to be included for use in the set
|
||||
/// </summary>
|
||||
[JsonObject("sample")]
|
||||
[XmlRoot("sample")]
|
||||
public class Sample : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -20,6 +22,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Name of the item
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -12,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents one ListXML confsetting or dipvalue
|
||||
/// </summary>
|
||||
[JsonObject("setting")]
|
||||
[XmlRoot("setting")]
|
||||
public class Setting : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -20,26 +22,36 @@ namespace SabreTools.Library.DatItems
|
||||
/// Setting name
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Setting value
|
||||
/// </summary>
|
||||
[JsonProperty("value", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("value")]
|
||||
public string Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Determines if the setting is default or not
|
||||
/// </summary>
|
||||
[JsonProperty("default", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("default")]
|
||||
public bool? Default { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool DefaultSpecified { get { return Default != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// List of conditions on the setting
|
||||
/// </summary>
|
||||
[JsonProperty("conditions", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("conditions")]
|
||||
public List<Condition> Conditions { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool ConditionsSpecified { get { return Conditions != null && Conditions.Count > 0; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Accessors
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -12,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents one shared feature object
|
||||
/// </summary>
|
||||
[JsonObject("sharedfeat")]
|
||||
[XmlRoot("sharedfeat")]
|
||||
public class SharedFeature : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -20,12 +22,14 @@ namespace SabreTools.Library.DatItems
|
||||
/// Name of the item
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SharedFeature value
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
[XmlElement("value")]
|
||||
public string Value { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -12,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents which Slot(s) is associated with a set
|
||||
/// </summary>
|
||||
[JsonObject("slot")]
|
||||
[XmlRoot("slot")]
|
||||
public class Slot : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -20,14 +22,19 @@ namespace SabreTools.Library.DatItems
|
||||
/// Name of the item
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Slot options associated with the slot
|
||||
/// </summary>
|
||||
[JsonProperty("slotoptions", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("slotoptions")]
|
||||
public List<SlotOption> SlotOptions { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool SlotOptionsSpecified { get { return SlotOptions != null && SlotOptions.Count > 0; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Accessors
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -12,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents one ListXML slotoption
|
||||
/// </summary>
|
||||
[JsonObject("slotoption")]
|
||||
[XmlRoot("slotoption")]
|
||||
public class SlotOption : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -20,20 +22,26 @@ namespace SabreTools.Library.DatItems
|
||||
/// Slot option name
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Referenced device name
|
||||
/// </summary>
|
||||
[JsonProperty("devname")]
|
||||
[XmlElement("devname")]
|
||||
public string DeviceName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Determines if this slot option is default or not
|
||||
/// </summary>
|
||||
[JsonProperty("default", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("default")]
|
||||
public bool? Default { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool DefaultSpecified { get { return Default != null; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Accessors
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -13,6 +14,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents which SoftwareList(s) is associated with a set
|
||||
/// </summary>
|
||||
[JsonObject("softwarelist")]
|
||||
[XmlRoot("softwarelist")]
|
||||
public class SoftwareList : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -21,6 +23,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Name of the item
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
[XmlElement("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -28,12 +31,17 @@ namespace SabreTools.Library.DatItems
|
||||
/// </summary>
|
||||
[JsonProperty("status", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
[XmlElement("status")]
|
||||
public SoftwareListStatus Status { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool StatusSpecified { get { return Status != SoftwareListStatus.NULL; } }
|
||||
|
||||
/// <summary>
|
||||
/// Filter to apply to the software list
|
||||
/// </summary>
|
||||
[JsonProperty("filter", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("filter")]
|
||||
public string Filter { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
using SabreTools.Library.Filtering;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -12,6 +13,7 @@ namespace SabreTools.Library.DatItems
|
||||
/// Represents the sound output for a machine
|
||||
/// </summary>
|
||||
[JsonObject("sound")]
|
||||
[XmlRoot("sound")]
|
||||
public class Sound : DatItem
|
||||
{
|
||||
#region Fields
|
||||
@@ -20,8 +22,12 @@ namespace SabreTools.Library.DatItems
|
||||
/// Number of speakers or channels
|
||||
/// </summary>
|
||||
[JsonProperty("channels", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("channels")]
|
||||
public long? Channels { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool ChannelsSpecified { get { return Channels != null; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Accessors
|
||||
|
||||
Reference in New Issue
Block a user