From b91d8fbe99ac56155e6b7547d2e4931832eeb9f4 Mon Sep 17 00:00:00 2001 From: Serghei Cebotari Date: Sun, 22 Oct 2023 13:43:18 +0300 Subject: Remove BuildRhSolutionsName methods --- .../ThreadElbowDoubleWallInternal.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'RhSolutions.QueryModifiers/DrinkingWaterHeatingFittings/ThreadElbowDoubleWallInternal.cs') 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у])(?длин)([\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 -- cgit v1.2.3