Files
SabreTools.Serialization/SabreTools.Metadata.DatItems/Formats/SoftwareList.cs

51 lines
1.5 KiB
C#
Raw Normal View History

2026-03-24 18:03:01 -04:00
using System.Xml.Serialization;
using Newtonsoft.Json;
2026-03-26 22:51:14 -04:00
using SabreTools.Data.Extensions;
2026-03-24 18:03:01 -04:00
namespace SabreTools.Metadata.DatItems.Formats
{
/// <summary>
/// Represents which SoftwareList(s) is associated with a set
/// </summary>
[JsonObject("softwarelist"), XmlRoot("softwarelist")]
public sealed class SoftwareList : DatItem<Data.Models.Metadata.SoftwareList>
{
#region Fields
/// <inheritdoc>/>
protected override ItemType ItemType => ItemType.SoftwareList;
#endregion
#region Constructors
public SoftwareList() : base() { }
public SoftwareList(Data.Models.Metadata.SoftwareList item) : base(item)
{
// Process flag values
2026-03-26 16:52:07 -04:00
string? status = ReadString(Data.Models.Metadata.SoftwareList.StatusKey);
if (status is not null)
2026-03-26 22:51:14 -04:00
Write<string?>(Data.Models.Metadata.SoftwareList.StatusKey, status.AsSoftwareListStatus()?.AsStringValue());
2026-03-24 18:03:01 -04:00
// Handle subitems
// TODO: Handle the Software subitem
}
public SoftwareList(Data.Models.Metadata.SoftwareList item, Machine machine, Source source) : this(item)
{
2026-03-26 13:52:00 -04:00
Write<Source?>(SourceKey, source);
2026-03-24 18:03:01 -04:00
CopyMachineInformation(machine);
}
#endregion
2026-03-26 23:46:20 -04:00
#region Cloning Methods
/// <inheritdoc/>
public override object Clone() => new SoftwareList(_internal.Clone() as Data.Models.Metadata.SoftwareList ?? []);
#endregion
2026-03-24 18:03:01 -04:00
}
}