34 lines
928 B
C#
34 lines
928 B
C#
using System.Collections.ObjectModel;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace Adaptation.FileHandlers.RsM;
|
|
|
|
internal record Line12
|
|
{
|
|
|
|
[JsonConstructor]
|
|
public Line12(string rangeFrom, string rangeTo)
|
|
{
|
|
RangeFrom = rangeFrom;
|
|
RangeTo = rangeTo;
|
|
}
|
|
|
|
[JsonPropertyName("RangeFrom")] public string RangeFrom { get; }
|
|
[JsonPropertyName("RangeTo")] public string RangeTo { get; }
|
|
|
|
internal static Line12 Get(string[] segments)
|
|
{
|
|
Line12 result;
|
|
ReadOnlyCollection<string> collection = Run.GetCollection(segments);
|
|
result = new(collection.Count < 1 ? string.Empty : collection[0],
|
|
collection.Count < 2 ? string.Empty : collection[1]);
|
|
return result;
|
|
}
|
|
|
|
}
|
|
|
|
[JsonSourceGenerationOptions(WriteIndented = true)]
|
|
[JsonSerializable(typeof(Line12))]
|
|
internal partial class Line12SourceGenerationContext : JsonSerializerContext
|
|
{
|
|
} |