Complete
This commit is contained in:
34
Adaptation/FileHandlers/RsM/Line12.cs
Normal file
34
Adaptation/FileHandlers/RsM/Line12.cs
Normal file
@ -0,0 +1,34 @@
|
||||
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 = Complete.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
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user