0
0
RhSolutions-Api/RhSolutions.Parsers/DrinkingWaterHeatingFittings/ManifoldG1.cs

28 lines
612 B
C#
Raw Permalink Normal View History

2024-01-27 15:09:26 +03:00
using System.Text.RegularExpressions;
2024-02-08 17:11:11 +03:00
namespace RhSolutions.Parsers.Fittings;
2024-01-27 15:09:26 +03:00
2024-02-08 17:11:11 +03:00
[ParserKey("Коллектор G1")]
2024-01-27 15:09:26 +03:00
public class ManifoldG1 : DrinkingWaterHeatingFitting
{
private static readonly Regex _portsCount =
2024-01-29 12:15:25 +03:00
new(@"\s(?<Ports>\d{1})\s");
2024-01-27 15:09:26 +03:00
protected override string _title => "Распределительный коллектор G1";
2024-02-08 17:11:11 +03:00
public override bool TryParse(string input, out string output)
2024-01-27 15:09:26 +03:00
{
var match = _portsCount.Match(input);
if (match.Success)
{
output = $"{_title} {match.Groups["Ports"]}";
return true;
}
else
{
output = string.Empty;
return false;
}
}
2024-01-29 11:34:22 +03:00
}