mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-04-27 08:39:47 +00:00
22 lines
594 B
C#
22 lines
594 B
C#
using SabreTools.Serialization.Interfaces;
|
|
|
|
namespace SabreTools.Serialization.Files
|
|
{
|
|
public partial class IRD : IFileSerializer<Models.IRD.File>
|
|
{
|
|
/// <inheritdoc/>
|
|
public bool Serialize(Models.IRD.File? obj, string? path)
|
|
{
|
|
if (string.IsNullOrEmpty(path))
|
|
return false;
|
|
|
|
using var stream = new Streams.IRD().Serialize(obj);
|
|
if (stream == null)
|
|
return false;
|
|
|
|
using var fs = System.IO.File.OpenWrite(path);
|
|
stream.CopyTo(fs);
|
|
return true;
|
|
}
|
|
}
|
|
} |