Make items XML serializable

This commit is contained in:
Matt Nadareski
2020-09-07 22:00:02 -07:00
parent d70415b989
commit 60818dba00
39 changed files with 523 additions and 94 deletions

View File

@@ -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