mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-04-05 22:01:33 +00:00
This change looks dramatic, but it's just separating out the already-split namespaces into separate top-level folders. In theory, every single one could be built into their own Nuget package. `SabreTools.Serialization` still builds the normal Nuget package that is used by all other projects and includes all namespaces.
40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
using System.Text;
|
|
|
|
namespace SabreTools.Serialization.Writers
|
|
{
|
|
public partial class XeMID : IStringWriter<Data.Models.Xbox.XeMID>
|
|
{
|
|
/// <inheritdoc/>
|
|
public bool Debug { get; set; } = false;
|
|
|
|
/// <inheritdoc cref="IStringWriter.Serialize(T?)"/>
|
|
public static string? SerializeString(Data.Models.Xbox.XeMID? obj)
|
|
{
|
|
var deserializer = new XeMID();
|
|
return deserializer.Serialize(obj);
|
|
}
|
|
|
|
/// <inheritdoc/>
|
|
public string? Serialize(Data.Models.Xbox.XeMID? obj)
|
|
{
|
|
if (obj is null)
|
|
return null;
|
|
|
|
var sb = new StringBuilder();
|
|
|
|
sb.Append(obj.PublisherIdentifier);
|
|
sb.Append(obj.PlatformIdentifier);
|
|
sb.Append(obj.GameID);
|
|
sb.Append(obj.SKU);
|
|
sb.Append(obj.RegionIdentifier);
|
|
sb.Append(obj.BaseVersion);
|
|
sb.Append(obj.MediaSubtypeIdentifier);
|
|
sb.Append(obj.DiscNumberIdentifier);
|
|
if (!string.IsNullOrEmpty(obj.CertificationSubmissionIdentifier))
|
|
sb.Append(obj.CertificationSubmissionIdentifier);
|
|
|
|
return sb.ToString();
|
|
}
|
|
}
|
|
}
|