Create Required attribute and tag properties

This commit is contained in:
Matt Nadareski
2023-08-10 12:09:29 -04:00
parent 1557882fe1
commit fb81fd0243
89 changed files with 316 additions and 155 deletions

View File

@@ -5,7 +5,8 @@ namespace SabreTools.Models.AttractMode
/// </summary>
public class MetadataFile
{
public string[] Header { get; set; }
[Required]
public string[]? Header { get; set; }
public Row[]? Row { get; set; }
}

View File

@@ -3,7 +3,8 @@ namespace SabreTools.Models.AttractMode
public class Row
{
/// <remarks>Also called Romname</remarks>
public string Name { get; set; }
[Required]
public string? Name { get; set; }
public string? Title { get; set; }

View File

@@ -4,7 +4,8 @@ namespace SabreTools.Models.ClrMamePro
public class Archive
{
/// <remarks>name</remarks>
public string Name { get; set; }
[Required]
public string? Name { get; set; }
#region DO NOT USE IN PRODUCTION

View File

@@ -4,10 +4,12 @@ namespace SabreTools.Models.ClrMamePro
public class BiosSet
{
/// <remarks>name</remarks>
public string Name { get; set; }
[Required]
public string? Name { get; set; }
/// <remarks>description</remarks>
public string Description { get; set; }
[Required]
public string? Description { get; set; }
/// <remarks>default</remarks>
public string? Default { get; set; }

View File

@@ -4,10 +4,12 @@ namespace SabreTools.Models.ClrMamePro
public class Chip
{
/// <remarks>type, (cpu|audio)</remarks>
public string Type { get; set; }
[Required]
public string? Type { get; set; }
/// <remarks>name</remarks>
public string Name { get; set; }
[Required]
public string? Name { get; set; }
/// <remarks>flags</remarks>
public string? Flags { get; set; }

View File

@@ -4,7 +4,8 @@ namespace SabreTools.Models.ClrMamePro
public class DipSwitch
{
/// <remarks>name</remarks>
public string Name { get; set; }
[Required]
public string? Name { get; set; }
/// <remarks>entry</remarks>
public string[]? Entry { get; set; }

View File

@@ -4,7 +4,8 @@ namespace SabreTools.Models.ClrMamePro
public class Disk
{
/// <remarks>name</remarks>
public string Name { get; set; }
[Required]
public string? Name { get; set; }
/// <remarks>md5</remarks>
public string? MD5 { get; set; }

View File

@@ -4,7 +4,8 @@ namespace SabreTools.Models.ClrMamePro
public class Driver
{
/// <remarks>status, (good|imperfect|preliminary)</remarks>
public string Status { get; set; }
[Required]
public string? Status { get; set; }
/// <remarks>color, (good|imperfect|preliminary)</remarks>
public string? Color { get; set; }

View File

@@ -6,7 +6,8 @@ namespace SabreTools.Models.ClrMamePro
public abstract class GameBase
{
/// <remarks>name</remarks>
public string Name { get; set; }
[Required]
public string? Name { get; set; }
/// <remarks>description</remarks>
public string? Description { get; set; }

View File

@@ -3,14 +3,16 @@ namespace SabreTools.Models.ClrMamePro
/// <remarks>input</remarks>
public class Input
{
/// <remarks>players, Numeric?/remarks>
public string Players { get; set; }
/// <remarks>players, Numeric/remarks>
[Required]
public string? Players { get; set; }
/// <remarks>control</remarks>
public string? Control { get; set; }
/// <remarks>buttons, Numeric</remarks>
public string Buttons { get; set; }
[Required]
public string? Buttons { get; set; }
/// <remarks>coins, Numeric</remarks>
public string? Coins { get; set; }

View File

@@ -4,7 +4,8 @@ namespace SabreTools.Models.ClrMamePro
public class Media
{
/// <remarks>name</remarks>
public string Name { get; set; }
[Required]
public string? Name { get; set; }
/// <remarks>md5</remarks>
public string? MD5 { get; set; }

View File

@@ -4,10 +4,12 @@ namespace SabreTools.Models.ClrMamePro
public class Release
{
/// <remarks>name</remarks>
public string Name { get; set; }
[Required]
public string? Name { get; set; }
/// <remarks>region</remarks>
public string Region { get; set; }
[Required]
public string? Region { get; set; }
/// <remarks>language</remarks>
public string? Language { get; set; }

View File

@@ -4,10 +4,12 @@ namespace SabreTools.Models.ClrMamePro
public class Rom
{
/// <remarks>name</remarks>
public string Name { get; set; }
[Required]
public string? Name { get; set; }
/// <remarks>size, Numeric</remarks>
public string Size { get; set; }
[Required]
public string? Size { get; set; }
/// <remarks>crc</remarks>
public string? CRC { get; set; }

View File

@@ -4,7 +4,8 @@ namespace SabreTools.Models.ClrMamePro
public class Sample
{
/// <remarks>name</remarks>
public string Name { get; set; }
[Required]
public string? Name { get; set; }
#region DO NOT USE IN PRODUCTION

View File

@@ -4,7 +4,8 @@ namespace SabreTools.Models.ClrMamePro
public class Sound
{
/// <remarks>channels, Numeric?</remarks>
public string Channels { get; set; }
[Required]
public string? Channels { get; set; }
#region DO NOT USE IN PRODUCTION

View File

@@ -4,10 +4,12 @@ namespace SabreTools.Models.ClrMamePro
public class Video
{
/// <remarks>screen, (raster|vector)</remarks>
public string Screen { get; set; }
[Required]
public string? Screen { get; set; }
/// <remarks>orientation, (vertical|horizontal)</remarks>
public string Orientation { get; set; }
[Required]
public string? Orientation { get; set; }
/// <remarks>x, Numeric?</remarks>
public string? X { get; set; }

View File

@@ -4,13 +4,16 @@ namespace SabreTools.Models.DosCenter
public class File
{
/// <remarks>name, attribute</remarks>
public string Name { get; set; }
[Required]
public string? Name { get; set; }
/// <remarks>size, attribute, numeric</remarks>
public string Size { get; set; }
[Required]
public string? Size { get; set; }
/// <remarks>crc, attribute</remarks>
public string CRC { get; set; }
[Required]
public string? CRC { get; set; }
/// <remarks>date, attribute</remarks>
public string? Date { get; set; }

View File

@@ -4,6 +4,7 @@ namespace SabreTools.Models.DosCenter
public class Game
{
/// <remarks>name</remarks>
[Required]
public string? Name { get; set; }
/// <remarks>file</remarks>

View File

@@ -5,15 +5,20 @@ namespace SabreTools.Models.EverdriveSMDB
/// </summary>
public class Row
{
public string SHA256 { get; set; }
[Required]
public string? SHA256 { get; set; }
public string Name { get; set; }
[Required]
public string? Name { get; set; }
public string SHA1 { get; set; }
[Required]
public string? SHA1 { get; set; }
public string MD5 { get; set; }
[Required]
public string? MD5 { get; set; }
public string CRC32 { get; set; }
[Required]
public string? CRC32 { get; set; }
public string? Size { get; set; }

View File

@@ -5,8 +5,10 @@ namespace SabreTools.Models.Hashfile
/// </summary>
public class MD5
{
public string Hash { get; set; }
[Required]
public string? Hash { get; set; }
public string File { get; set; }
[Required]
public string? File { get; set; }
}
}

View File

@@ -5,8 +5,10 @@ namespace SabreTools.Models.Hashfile
/// </summary>
public class SFV
{
public string File { get; set; }
[Required]
public string? File { get; set; }
public string Hash { get; set; }
[Required]
public string? Hash { get; set; }
}
}

View File

@@ -5,8 +5,10 @@ namespace SabreTools.Models.Hashfile
/// </summary>
public class SHA1
{
public string Hash { get; set; }
[Required]
public string? Hash { get; set; }
public string File { get; set; }
[Required]
public string? File { get; set; }
}
}

View File

@@ -5,8 +5,10 @@ namespace SabreTools.Models.Hashfile
/// </summary>
public class SHA256
{
public string Hash { get; set; }
[Required]
public string? Hash { get; set; }
public string File { get; set; }
[Required]
public string? File { get; set; }
}
}

View File

@@ -5,8 +5,10 @@ namespace SabreTools.Models.Hashfile
/// </summary>
public class SHA384
{
public string Hash { get; set; }
[Required]
public string? Hash { get; set; }
public string File { get; set; }
[Required]
public string? File { get; set; }
}
}

View File

@@ -5,8 +5,10 @@ namespace SabreTools.Models.Hashfile
/// </summary>
public class SHA512
{
public string Hash { get; set; }
[Required]
public string? Hash { get; set; }
public string File { get; set; }
[Required]
public string? File { get; set; }
}
}

View File

@@ -5,8 +5,10 @@ namespace SabreTools.Models.Hashfile
/// </summary>
public class SpamSum
{
public string Hash { get; set; }
[Required]
public string? Hash { get; set; }
public string File { get; set; }
[Required]
public string? File { get; set; }
}
}

View File

@@ -14,7 +14,8 @@ namespace SabreTools.Models.Listrom
/// </summary>
public class Row
{
public string Name { get; set; }
[Required]
public string? Name { get; set; }
public string? Size { get; set; }

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.Listxml
[XmlRoot("adjuster")]
public class Adjuster
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
/// <remarks>(yes|no) "no"</remarks>
[XmlAttribute("default")]

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.Listxml
[XmlRoot("analog")]
public class Analog
{
[Required]
[XmlAttribute("mask")]
public string Mask { get; set; }
public string? Mask { get; set; }
#region DO NOT USE IN PRODUCTION

View File

@@ -6,11 +6,13 @@ namespace SabreTools.Models.Listxml
[XmlRoot("biosset")]
public class BiosSet
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[Required]
[XmlAttribute("description")]
public string Description { get; set; }
public string? Description { get; set; }
/// <remarks>(yes|no) "no"</remarks>
[XmlAttribute("default")]

View File

@@ -6,15 +6,17 @@ namespace SabreTools.Models.Listxml
[XmlRoot("chip")]
public class Chip
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[XmlAttribute("tag")]
public string? Tag { get; set; }
/// <remarks>(cpu|audio)</remarks>
[Required]
[XmlAttribute("type")]
public string Type { get; set; }
public string? Type { get; set; }
/// <remarks>Only present in older versions</remarks>
[XmlAttribute("soundonly")]

View File

@@ -6,18 +6,22 @@ namespace SabreTools.Models.Listxml
[XmlRoot("condition")]
public class Condition
{
[Required]
[XmlAttribute("tag")]
public string Tag { get; set; }
public string? Tag { get; set; }
[Required]
[XmlAttribute("mask")]
public string Mask { get; set; }
public string? Mask { get; set; }
/// <remarks>(eq|ne|gt|le|lt|ge)</remarks>
[Required]
[XmlAttribute("relation")]
public string Relation { get; set; }
public string? Relation { get; set; }
[Required]
[XmlAttribute("value")]
public string Value { get; set; }
public string? Value { get; set; }
#region DO NOT USE IN PRODUCTION

View File

@@ -6,12 +6,14 @@ namespace SabreTools.Models.Listxml
[XmlRoot("conflocation")]
public class ConfLocation
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
/// <remarks>Numeric?</remarks>
[Required]
[XmlAttribute("number")]
public string Number { get; set; }
public string? Number { get; set; }
/// <remarks>(yes|no) "no"</remarks>
[XmlAttribute("inverted")]

View File

@@ -6,11 +6,13 @@ namespace SabreTools.Models.Listxml
[XmlRoot("confsetting")]
public class ConfSetting
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[Required]
[XmlAttribute("value")]
public string Value { get; set; }
public string? Value { get; set; }
/// <remarks>(yes|no) "no"</remarks>
[XmlAttribute("default")]

View File

@@ -6,11 +6,13 @@ namespace SabreTools.Models.Listxml
[XmlRoot("configuration")]
public class Configuration
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[Required]
[XmlAttribute("tag")]
public string Tag { get; set; }
public string? Tag { get; set; }
[XmlAttribute("mask")]
public string? Mask { get; set; }

View File

@@ -7,8 +7,9 @@ namespace SabreTools.Models.Listxml
public class Control
{
/// <remarks>(joy|stick|paddle|pedal|lightgun|positional|dial|trackball|mouse|only_buttons|keypad|keyboard|mahjong|hanafuda|gambling)</remarks>
[Required]
[XmlAttribute("type")]
public string Type { get; set; }
public string? Type { get; set; }
/// <remarks>Numeric</remarks>
[XmlAttribute("player")]

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.Listxml
[XmlRoot("device")]
public class Device
{
[Required]
[XmlAttribute("type")]
public string Type { get; set; }
public string? Type { get; set; }
[XmlAttribute("tag")]
public string? Tag { get; set; }

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.Listxml
[XmlRoot("device_ref")]
public class DeviceRef
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
#region DO NOT USE IN PRODUCTION

View File

@@ -6,12 +6,14 @@ namespace SabreTools.Models.Listxml
[XmlRoot("diplocation")]
public class DipLocation
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
/// <remarks>Numeric?</remarks>
[Required]
[XmlAttribute("number")]
public string Number { get; set; }
public string? Number { get; set; }
/// <remarks>(yes|no) "no"</remarks>
[XmlAttribute("inverted")]

View File

@@ -6,11 +6,13 @@ namespace SabreTools.Models.Listxml
[XmlRoot("dipswitch")]
public class DipSwitch
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[Required]
[XmlAttribute("tag")]
public string Tag { get; set; }
public string? Tag { get; set; }
[XmlAttribute("mask")]
public string? Mask { get; set; }

View File

@@ -6,11 +6,13 @@ namespace SabreTools.Models.Listxml
[XmlRoot("dipvalue")]
public class DipValue
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[Required]
[XmlAttribute("value")]
public string Value { get; set; }
public string? Value { get; set; }
/// <remarks>(yes|no) "no"</remarks>
[XmlAttribute("default")]

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.Listxml
[XmlRoot("disk")]
public class Disk
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
/// <remarks>Only present in older versions</remarks>
[XmlAttribute("md5")]

View File

@@ -10,8 +10,9 @@ namespace SabreTools.Models.Listxml
public string? Tag { get; set; }
/// <remarks>(raster|vector|lcd|svg|unknown)</remarks>
[Required]
[XmlAttribute("type")]
public string Type { get; set; }
public string? Type { get; set; }
/// <remarks>(0|90|180|270)</remarks>
[XmlAttribute("rotate")]
@@ -30,8 +31,9 @@ namespace SabreTools.Models.Listxml
public string? Height { get; set; }
/// <remarks>Numeric</remarks>
[Required]
[XmlAttribute("refresh")]
public string Refresh { get; set; }
public string? Refresh { get; set; }
/// <remarks>Numeric</remarks>
[XmlAttribute("pixclock")]

View File

@@ -7,8 +7,9 @@ namespace SabreTools.Models.Listxml
public class Driver
{
/// <remarks>(good|imperfect|preliminary), (good|preliminary|test) in older versions</remarks>
[Required]
[XmlAttribute("status")]
public string Status { get; set; }
public string? Status { get; set; }
/// <remarks>(good|imperfect|preliminary), Only present in older versions</remarks>
[XmlAttribute("color")]
@@ -23,16 +24,19 @@ namespace SabreTools.Models.Listxml
public string? PaletteSize { get; set; }
/// <remarks>(good|imperfect|preliminary)</remarks>
[Required]
[XmlAttribute("emulation")]
public string Emulation { get; set; }
public string? Emulation { get; set; }
/// <remarks>(good|imperfect|preliminary)</remarks>
[Required]
[XmlAttribute("cocktail")]
public string Cocktail { get; set; }
public string? Cocktail { get; set; }
/// <remarks>(supported|unsupported)</remarks>
[Required]
[XmlAttribute("savestate")]
public string SaveState { get; set; }
public string? SaveState { get; set; }
/// <remarks>(yes|no) "no"</remarks>
[XmlAttribute("requiresartwork")]

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.Listxml
[XmlRoot("extension")]
public class Extension
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
#region DO NOT USE IN PRODUCTION

View File

@@ -7,8 +7,9 @@ namespace SabreTools.Models.Listxml
public class Feature
{
/// <remarks>(protection|timing|graphics|palette|sound|capture|camera|microphone|controls|keyboard|mouse|media|disk|printer|tape|punch|drum|rom|comms|lan|wan)</remarks>
[Required]
[XmlAttribute("type")]
public string Type { get; set; }
public string? Type { get; set; }
/// <remarks>(unemulated|imperfect)</remarks>
[XmlAttribute("status")]

View File

@@ -8,8 +8,9 @@ namespace SabreTools.Models.Listxml
/// </summary>
public abstract class GameBase
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
/// <remarks>Machine only</remarks>
[XmlAttribute("sourcefile")]
@@ -40,8 +41,9 @@ namespace SabreTools.Models.Listxml
[XmlAttribute("sampleof")]
public string? SampleOf { get; set; }
[Required]
[XmlElement("description")]
public string Description { get; set; }
public string? Description { get; set; }
[XmlElement("year")]
public string? Year { get; set; }

View File

@@ -15,8 +15,9 @@ namespace SabreTools.Models.Listxml
public string? Tilt { get; set; }
/// <remarks>Numeric</remarks>
[Required]
[XmlAttribute("players")]
public string Players { get; set; }
public string? Players { get; set; }
/// <remarks>Only present in older versions</remarks>
[XmlAttribute("control")]

View File

@@ -6,11 +6,13 @@ namespace SabreTools.Models.Listxml
[XmlRoot("instance")]
public class Instance
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[Required]
[XmlAttribute("briefname")]
public string BriefName { get; set; }
public string? BriefName { get; set; }
#region DO NOT USE IN PRODUCTION

View File

@@ -11,7 +11,7 @@ namespace SabreTools.Models.Listxml
[XmlElement("machine", typeof(Machine))]
[XmlElement("game", typeof(Game))]
public GameBase[] Game { get; set; }
public GameBase[]? Game { get; set; }
#region DO NOT USE IN PRODUCTION

View File

@@ -13,12 +13,13 @@ namespace SabreTools.Models.Listxml
[XmlAttribute("debug")]
public string? Debug { get; set; }
[Required]
[XmlAttribute("mameconfig")]
public string MameConfig { get; set; }
public string? MameConfig { get; set; }
[XmlElement("machine", typeof(Machine))]
[XmlElement("game", typeof(Game))]
public GameBase[] Game { get; set; }
public GameBase[]? Game { get; set; }
#region DO NOT USE IN PRODUCTION

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.Listxml
[XmlRoot("port")]
public class Port
{
[Required]
[XmlAttribute("tag")]
public string Tag { get; set; }
public string? Tag { get; set; }
[XmlElement("analog")]
public Analog[]? Analog { get; set; }

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.Listxml
[XmlRoot("ramoption")]
public class RamOption
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[XmlAttribute("default")]
public string? Default { get; set; }

View File

@@ -6,15 +6,17 @@ namespace SabreTools.Models.Listxml
[XmlRoot("rom")]
public class Rom
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[XmlAttribute("bios")]
public string? Bios { get; set; }
/// <remarks>Numeric</remarks>
[Required]
[XmlAttribute("size")]
public string Size { get; set; }
public string? Size { get; set; }
[XmlAttribute("crc")]
public string? CRC { get; set; }

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.Listxml
[XmlRoot("sample")]
public class Sample
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
#region DO NOT USE IN PRODUCTION

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.Listxml
[XmlRoot("slot")]
public class Slot
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[XmlElement("slotoption")]
public SlotOption[]? SlotOption { get; set; }

View File

@@ -6,11 +6,13 @@ namespace SabreTools.Models.Listxml
[XmlRoot("slotoption")]
public class SlotOption
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[Required]
[XmlAttribute("devname")]
public string DevName { get; set; }
public string? DevName { get; set; }
/// <remarks>(yes|no) "no"</remarks>
[XmlAttribute("default")]

View File

@@ -6,15 +6,18 @@ namespace SabreTools.Models.Listxml
[XmlRoot("softwarelist")]
public class SoftwareList
{
[Required]
[XmlAttribute("tag")]
public string Tag { get; set; }
public string? Tag { get; set; }
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
/// <remarks>(original|compatible)</remarks>
[Required]
[XmlAttribute("status")]
public string Status { get; set; }
public string? Status { get; set; }
[XmlAttribute("filter")]
public string? Filter { get; set; }

View File

@@ -7,8 +7,9 @@ namespace SabreTools.Models.Listxml
public class Sound
{
/// <remarks>Numeric</remarks>
[Required]
[XmlAttribute("channels")]
public string Channels { get; set; }
public string? Channels { get; set; }
#region DO NOT USE IN PRODUCTION

View File

@@ -7,12 +7,14 @@ namespace SabreTools.Models.Listxml
public class Video
{
/// <remarks>(raster|vector)</remarks>
[Required]
[XmlAttribute("screen")]
public string Screen { get; set; }
public string? Screen { get; set; }
/// <remarks>(vertical|horizontal)</remarks>
[Required]
[XmlAttribute("orientation")]
public string Orientation { get; set; }
public string? Orientation { get; set; }
/// <remarks>Numeric</remarks>
[XmlAttribute("width")]

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.Logiqx
[XmlRoot("archive")]
public class Archive
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
#region DO NOT USE IN PRODUCTION

View File

@@ -6,11 +6,13 @@ namespace SabreTools.Models.Logiqx
[XmlRoot("biosset")]
public class BiosSet
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[Required]
[XmlAttribute("description")]
public string Description { get; set; }
public string? Description { get; set; }
/// <remarks>(yes|no) "no"</remarks>
[XmlAttribute("default")]

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.Logiqx
[XmlRoot("device_ref")]
public class DeviceRef
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
#region DO NOT USE IN PRODUCTION

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.Logiqx
[XmlRoot("dir")]
public class Dir
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[XmlElement("game", typeof(Game))]
[XmlElement("machine", typeof(Machine))]

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.Logiqx
[XmlRoot("disk")]
public class Disk
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[XmlAttribute("md5")]
public string? MD5 { get; set; }

View File

@@ -7,20 +7,24 @@ namespace SabreTools.Models.Logiqx
public class Driver
{
/// <remarks>(good|imperfect|preliminary)</remarks>
[Required]
[XmlAttribute("status")]
public string Status { get; set; }
public string? Status { get; set; }
/// <remarks>(good|imperfect|preliminary)</remarks>
[Required]
[XmlAttribute("emulation")]
public string Emulation { get; set; }
public string? Emulation { get; set; }
/// <remarks>(good|imperfect|preliminary)</remarks>
[Required]
[XmlAttribute("cocktail")]
public string Cocktail { get; set; }
public string? Cocktail { get; set; }
/// <remarks>(supported|unsupported)</remarks>
[Required]
[XmlAttribute("savestate")]
public string SaveState { get; set; }
public string? SaveState { get; set; }
/// <remarks>(yes|no) "no"</remarks>
[XmlAttribute("requiresartwork")]

View File

@@ -8,8 +8,9 @@ namespace SabreTools.Models.Logiqx
/// </summary>
public abstract class GameBase
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[XmlAttribute("sourcefile")]
public string? SourceFile { get; set; }
@@ -56,8 +57,9 @@ namespace SabreTools.Models.Logiqx
[XmlElement("comment")]
public string[]? Comment { get; set; }
[Required]
[XmlElement("description")]
public string Description { get; set; }
public string? Description { get; set; }
[XmlElement("year")]
public string? Year { get; set; }

View File

@@ -10,11 +10,13 @@ namespace SabreTools.Models.Logiqx
[XmlElement("id")]
public string? Id { get; set; }
[Required]
[XmlElement("name")]
public string Name { get; set; }
public string? Name { get; set; }
[Required]
[XmlElement("description")]
public string Description { get; set; }
public string? Description { get; set; }
/// <remarks>Trurip extension</remarks>
[XmlElement("rootdir")]
@@ -23,14 +25,16 @@ namespace SabreTools.Models.Logiqx
[XmlElement("category")]
public string? Category { get; set; }
[Required]
[XmlElement("version")]
public string Version { get; set; }
public string? Version { get; set; }
[XmlElement("date")]
public string? Date { get; set; }
[Required]
[XmlElement("author")]
public string Author { get; set; }
public string? Author { get; set; }
[XmlElement("email")]
public string? Email { get; set; }

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.Logiqx
[XmlRoot("media")]
public class Media
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[XmlAttribute("md5")]
public string? MD5 { get; set; }

View File

@@ -6,11 +6,13 @@ namespace SabreTools.Models.Logiqx
[XmlRoot("release")]
public class Release
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[Required]
[XmlAttribute("region")]
public string Region { get; set; }
public string? Region { get; set; }
[XmlAttribute("language")]
public string? Language { get; set; }

View File

@@ -6,11 +6,13 @@ namespace SabreTools.Models.Logiqx
[XmlRoot("rom")]
public class Rom
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[Required]
[XmlAttribute("size")]
public string Size { get; set; }
public string? Size { get; set; }
[XmlAttribute("crc")]
public string? CRC { get; set; }

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.Logiqx
[XmlRoot("sample")]
public class Sample
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
#region DO NOT USE IN PRODUCTION

View File

@@ -6,15 +6,18 @@ namespace SabreTools.Models.Logiqx
[XmlRoot("softwarelist")]
public class SoftwareList
{
[Required]
[XmlAttribute("tag")]
public string Tag { get; set; }
public string? Tag { get; set; }
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
/// <remarks>(original|compatible)</remarks>
[Required]
[XmlAttribute("status")]
public string Status { get; set; }
public string? Status { get; set; }
[XmlAttribute("filter")]
public string? Filter { get; set; }

View File

@@ -6,23 +6,28 @@ namespace SabreTools.Models.OpenMSX
[XmlRoot("software")]
public class Software
{
[Required]
[XmlElement("title")]
public string Title { get; set; }
public string? Title { get; set; }
[XmlElement("genmsxid")]
public string? GenMSXID { get; set; }
[Required]
[XmlElement("system")]
public string System { get; set; }
public string? System { get; set; }
[Required]
[XmlElement("company")]
public string Company { get; set; }
public string? Company { get; set; }
[Required]
[XmlElement("year")]
public string Year { get; set; }
public string? Year { get; set; }
[Required]
[XmlElement("country")]
public string Country { get; set; }
public string? Country { get; set; }
[XmlElement("dump")]
public Dump[]? Dump { get; set; }

View File

@@ -0,0 +1,9 @@
namespace SabreTools.Models
{
/// <summary>
/// Marks a property as required on write
/// </summary>
/// <remarks>TODO: Use reflection to determine required fields on write</remarks>
[System.AttributeUsage(System.AttributeTargets.Property)]
public class RequiredAttribute : System.Attribute { }
}

View File

@@ -2,7 +2,8 @@ namespace SabreTools.Models.SeparatedValue
{
public class MetadataFile
{
public string[] Header { get; set; }
[Required]
public string[]? Header { get; set; }
public Row[]? Row { get; set; }
}

View File

@@ -15,13 +15,15 @@ namespace SabreTools.Models.SeparatedValue
public string? Description { get; set; }
/// <remarks>Game Name</remarks>
public string GameName { get; set; }
[Required]
public string? GameName { get; set; }
/// <remarks>Game Description</remarks>
public string? GameDescription { get; set; }
/// <remarks>Type</remarks>
public string Type { get; set; }
[Required]
public string? Type { get; set; }
/// <remarks>Rom Name</remarks>
public string? RomName { get; set; }

View File

@@ -6,11 +6,13 @@ namespace SabreTools.Models.SoftwareList
[XmlRoot("dataarea")]
public class DataArea
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[Required]
[XmlAttribute("size")]
public string Size { get; set; }
public string? Size { get; set; }
/// <remarks>(8|16|32|64) "8"</remarks>
[XmlAttribute("width")]

View File

@@ -6,11 +6,13 @@ namespace SabreTools.Models.SoftwareList
[XmlRoot("dipswitch")]
public class DipSwitch
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[Required]
[XmlAttribute("tag")]
public string Tag { get; set; }
public string? Tag { get; set; }
[XmlAttribute("mask")]
public string? Mask { get; set; }

View File

@@ -6,11 +6,13 @@ namespace SabreTools.Models.SoftwareList
[XmlRoot("dipvalue")]
public class DipValue
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[Required]
[XmlAttribute("value")]
public string Value { get; set; }
public string? Value { get; set; }
/// <remarks>(yes|no) "no"</remarks>
[XmlAttribute("default")]

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.SoftwareList
[XmlRoot("disk")]
public class Disk
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[XmlAttribute("md5")]
public string? MD5 { get; set; }

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.SoftwareList
[XmlRoot("diskarea")]
public class DiskArea
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[XmlElement("disk")]
public Disk[]? Disk { get; set; }

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.SoftwareList
[XmlRoot("feature")]
public class Feature
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[XmlAttribute("value")]
public string? Value { get; set; }

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.SoftwareList
[XmlRoot("info")]
public class Info
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[XmlAttribute("value")]
public string? Value { get; set; }

View File

@@ -6,11 +6,13 @@ namespace SabreTools.Models.SoftwareList
[XmlRoot("part")]
public class Part
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[Required]
[XmlAttribute("interface")]
public string Interface { get; set; }
public string? Interface { get; set; }
[XmlElement("feature")]
public Feature[]? Feature { get; set; }

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.SoftwareList
[XmlRoot("rom")]
public class Rom
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[XmlAttribute("size")]
public string? Size { get; set; }

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.SoftwareList
[XmlRoot("sharedfeat")]
public class SharedFeat
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[XmlAttribute("value")]
public string? Value { get; set; }

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.SoftwareList
[XmlRoot("software")]
public class Software
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[XmlAttribute("cloneof")]
public string? CloneOf { get; set; }
@@ -16,14 +17,17 @@ namespace SabreTools.Models.SoftwareList
[XmlAttribute("supported")]
public string? Supported { get; set; }
[Required]
[XmlElement("description")]
public string Description { get; set; }
public string? Description { get; set; }
[Required]
[XmlElement("year")]
public string Year { get; set; }
public string? Year { get; set; }
[Required]
[XmlElement("publisher")]
public string Publisher { get; set; }
public string? Publisher { get; set; }
[XmlElement("notes")]
public string? Notes { get; set; }

View File

@@ -6,8 +6,9 @@ namespace SabreTools.Models.SoftwareList
[XmlRoot("softwarelist")]
public class SoftwareList
{
[Required]
[XmlAttribute("name")]
public string Name { get; set; }
public string? Name { get; set; }
[XmlAttribute("description")]
public string? Description { get; set; }
@@ -16,7 +17,7 @@ namespace SabreTools.Models.SoftwareList
public string? Notes { get; set; }
[XmlElement("software")]
public Software[] Software { get; set; }
public Software[]? Software { get; set; }
#region DO NOT USE IN PRODUCTION