summaryrefslogtreecommitdiff
path: root/RhSolutions.MLModifiers/DrinkingWaterHeatingFittings/ManifoldG1.cs
blob: 5e364a830cbe182413c0c59bddf8b352611a3c28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System.Text.RegularExpressions;

namespace RhSolutions.MLModifiers.DrinkingWaterHeatingFittings;

[MLModifierKey("Коллектор G1")]
public class ManifoldG1 : DrinkingWaterHeatingFitting
{
	private static readonly Regex _portsCount =
		new(@"\s(?<Ports>\d{1})\s");

	protected override string _title => "Распределительный коллектор G1";

	public override bool TryQueryModify(string input, out string output)
	{
		var match = _portsCount.Match(input);
		if (match.Success)
		{
			output = $"{_title} {match.Groups["Ports"]}";
			return true;
		}
		else
		{
			output = string.Empty;
			return false;
		}
	}
}