34 lines
929 B
C#
34 lines
929 B
C#
using System.Collections.ObjectModel;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace Adaptation.FileHandlers.RsM;
|
|
|
|
internal record Line5
|
|
{
|
|
|
|
[JsonConstructor]
|
|
public Line5(string @operator, string equipment)
|
|
{
|
|
Operator = @operator;
|
|
Equipment = equipment;
|
|
}
|
|
|
|
[JsonPropertyName("Operator")] public string Operator { get; }
|
|
[JsonPropertyName("Epuipment")] public string Equipment { get; }
|
|
|
|
internal static Line5 Get(string[] segments)
|
|
{
|
|
Line5 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(Line5))]
|
|
internal partial class Line5SourceGenerationContext : JsonSerializerContext
|
|
{
|
|
} |