0
0
RhSolutions-Api/RhSolutions.QueryModifiers/DrinkingWaterHeatingFittings/Adapter.cs

24 lines
549 B
C#
Raw Permalink Normal View History

2023-10-13 15:04:27 +03:00
using System.Text.RegularExpressions;
namespace RhSolutions.QueryModifiers.DrinkingWaterHeatingFittings;
public abstract class Adapter : DrinkingWaterHeatingFitting
{
2023-10-22 13:43:18 +03:00
public override bool TryQueryModify(string input, out string output)
{
output = string.Empty;
Match diameter = _diameter.Match(input);
2023-10-13 15:04:27 +03:00
if (!diameter.Success)
{
2023-10-22 13:43:18 +03:00
return false;
2023-10-13 15:04:27 +03:00
}
2023-10-22 13:43:18 +03:00
Match thread = _thread.Match(input);
2023-10-13 15:04:27 +03:00
if (!thread.Success)
{
2023-10-22 13:43:18 +03:00
return false;
2023-10-13 15:04:27 +03:00
}
2023-10-22 13:43:18 +03:00
output = $"{_title} {diameter.Groups["Diameter"]} {thread.Groups["Thread"]}";
return true;
2023-10-13 15:04:27 +03:00
}
}