Files
SabreTools.Serialization/SabreTools.Data.Models/Metadata/Original.cs

51 lines
1.2 KiB
C#
Raw Normal View History

2026-04-03 13:48:43 -04:00
using System;
2025-09-26 10:20:48 -04:00
using System.Xml.Serialization;
using Newtonsoft.Json;
2025-09-26 13:06:18 -04:00
namespace SabreTools.Data.Models.Metadata
2025-09-26 10:20:48 -04:00
{
[JsonObject("original"), XmlRoot("original")]
2026-04-03 13:48:43 -04:00
public class Original : DatItem, ICloneable, IEquatable<Original>
2025-09-26 10:20:48 -04:00
{
2026-04-02 14:28:46 -04:00
#region Properties
public string? Content { get; set; }
2025-09-26 10:20:48 -04:00
2026-04-03 13:48:43 -04:00
public bool? Value { get; set; }
2026-04-02 14:28:46 -04:00
#endregion
2026-04-03 13:48:43 -04:00
public Original() => ItemType = ItemType.Original;
2025-09-26 10:20:48 -04:00
2026-04-03 13:48:43 -04:00
/// <inheritdoc/>
public object Clone()
{
var obj = new Original();
2025-09-26 10:20:48 -04:00
2026-04-03 13:48:43 -04:00
obj.Content = Content;
obj.Value = Value;
2025-09-26 10:20:48 -04:00
2026-04-03 13:48:43 -04:00
return obj;
}
/// <inheritdoc/>
public bool Equals(Original? other)
{
// Null never matches
if (other is null)
return false;
// Properties
if ((Content is null) ^ (other.Content is null))
return false;
else if (Content is not null && !Content.Equals(other.Content, StringComparison.OrdinalIgnoreCase))
return false;
if (Value != other.Value)
return false;
return true;
}
2025-09-26 10:20:48 -04:00
}
}