27 lines
662 B
C#
27 lines
662 B
C#
using System.Text.RegularExpressions;
|
|
|
|
namespace RhSolutions.MLModifiers.DrinkingWaterHeatingFittings;
|
|
|
|
[MLModifierKey("Коллектор G1")]
|
|
public class ManifoldG1 : DrinkingWaterHeatingFitting
|
|
{
|
|
private static readonly Regex _portsCount =
|
|
new(@"([\b\D]|^)?(?<Ports>2|3|4)([\b\D]|$)");
|
|
|
|
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;
|
|
}
|
|
}
|
|
} |