mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-04-29 10:16:43 +00:00
Add Xbox string serialization
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Strings
|
||||
@@ -7,9 +7,22 @@ namespace SabreTools.Serialization.Strings
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
#if NET48
|
||||
public string Serialize(Models.Xbox.XMID obj) => throw new NotImplementedException();
|
||||
public string Serialize(Models.Xbox.XMID obj)
|
||||
#else
|
||||
public string? Serialize(Models.Xbox.XMID? obj) => throw new NotImplementedException();
|
||||
public string? Serialize(Models.Xbox.XMID? obj)
|
||||
#endif
|
||||
{
|
||||
if (obj == null)
|
||||
return null;
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
sb.Append(obj.PublisherIdentifier);
|
||||
sb.Append(obj.GameID);
|
||||
sb.Append(obj.VersionNumber);
|
||||
sb.Append(obj.RegionIdentifier);
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using SabreTools.Serialization.Interfaces;
|
||||
|
||||
namespace SabreTools.Serialization.Strings
|
||||
@@ -7,9 +7,28 @@ namespace SabreTools.Serialization.Strings
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
#if NET48
|
||||
public string Serialize(Models.Xbox.XeMID obj) => throw new NotImplementedException();
|
||||
public string Serialize(Models.Xbox.XeMID obj)
|
||||
#else
|
||||
public string? Serialize(Models.Xbox.XeMID? obj) => throw new NotImplementedException();
|
||||
public string? Serialize(Models.Xbox.XeMID? obj)
|
||||
#endif
|
||||
{
|
||||
if (obj == 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.IsNullOrWhiteSpace(obj.CertificationSubmissionIdentifier))
|
||||
sb.Append(obj.CertificationSubmissionIdentifier);
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user