summaryrefslogtreecommitdiff
path: root/RhSolutions.QueryModifiers/DrinkingWaterHeatingFittings/ThreadElbowDoubleWallInternal.cs
diff options
context:
space:
mode:
Diffstat (limited to 'RhSolutions.QueryModifiers/DrinkingWaterHeatingFittings/ThreadElbowDoubleWallInternal.cs')
-rw-r--r--RhSolutions.QueryModifiers/DrinkingWaterHeatingFittings/ThreadElbowDoubleWallInternal.cs16
1 files changed, 9 insertions, 7 deletions
diff --git a/RhSolutions.QueryModifiers/DrinkingWaterHeatingFittings/ThreadElbowDoubleWallInternal.cs b/RhSolutions.QueryModifiers/DrinkingWaterHeatingFittings/ThreadElbowDoubleWallInternal.cs
index 69799ed..d6772bf 100644
--- a/RhSolutions.QueryModifiers/DrinkingWaterHeatingFittings/ThreadElbowDoubleWallInternal.cs
+++ b/RhSolutions.QueryModifiers/DrinkingWaterHeatingFittings/ThreadElbowDoubleWallInternal.cs
@@ -7,23 +7,25 @@ public class ThreadElbowDoubleWallInternal : DrinkingWaterHeatingFitting
protected override string _title => "Проточный настенный угольник";
private Regex _type = new(@"([\b\Wу])(?<Type>длин)([\b\w\.\s])");
- protected override string? BuildRhSolutionsName(string query)
+ public override bool TryQueryModify(string input, out string output)
{
- var diameterMatches = _diameter.Matches(query);
+ output = string.Empty;
+ var diameterMatches = _diameter.Matches(input);
if (diameterMatches.Count == 0)
{
- return null;
+ return false;
}
- var threadMatch = _thread.Match(query);
+ var threadMatch = _thread.Match(input);
if (!threadMatch.Success)
{
- return null;
+ return false;
}
- var typeMatch = _type.Match(query);
+ var typeMatch = _type.Match(input);
string[] diameters = diameterMatches.Select(x => x.Groups["Diameter"].Value).ToArray();
string thread = threadMatch.Groups["Thread"].Value;
string type = typeMatch.Success ? "длинный" : "короткий";
- return $"{_title} {diameters[0]}/{(diameters.Length > 1 ? diameters[1] : diameters[0])}-Rp {thread} {type}";
+ output = $"{_title} {diameters[0]}/{(diameters.Length > 1 ? diameters[1] : diameters[0])}-Rp {thread} {type}";
+ return true;
}
} \ No newline at end of file