diff options
Diffstat (limited to 'RhSolutions.QueryModifiers/DrinkingWaterHeatingFittings')
-rw-r--r-- | RhSolutions.QueryModifiers/DrinkingWaterHeatingFittings/DrinkingWaterHeatingFitting.cs | 2 | ||||
-rw-r--r-- | RhSolutions.QueryModifiers/DrinkingWaterHeatingFittings/ThreadElbowDoubleWallInternal.cs | 29 |
2 files changed, 30 insertions, 1 deletions
diff --git a/RhSolutions.QueryModifiers/DrinkingWaterHeatingFittings/DrinkingWaterHeatingFitting.cs b/RhSolutions.QueryModifiers/DrinkingWaterHeatingFittings/DrinkingWaterHeatingFitting.cs index 0adfac6..4ea9574 100644 --- a/RhSolutions.QueryModifiers/DrinkingWaterHeatingFittings/DrinkingWaterHeatingFitting.cs +++ b/RhSolutions.QueryModifiers/DrinkingWaterHeatingFittings/DrinkingWaterHeatingFitting.cs @@ -45,4 +45,4 @@ public abstract class DrinkingWaterHeatingFitting : IProductQueryModifier } return null; } -}
\ No newline at end of file +} diff --git a/RhSolutions.QueryModifiers/DrinkingWaterHeatingFittings/ThreadElbowDoubleWallInternal.cs b/RhSolutions.QueryModifiers/DrinkingWaterHeatingFittings/ThreadElbowDoubleWallInternal.cs new file mode 100644 index 0000000..69799ed --- /dev/null +++ b/RhSolutions.QueryModifiers/DrinkingWaterHeatingFittings/ThreadElbowDoubleWallInternal.cs @@ -0,0 +1,29 @@ +using System.Text.RegularExpressions; + +namespace RhSolutions.QueryModifiers.DrinkingWaterHeatingFittings; + +public class ThreadElbowDoubleWallInternal : DrinkingWaterHeatingFitting +{ + protected override string _title => "Проточный настенный угольник"; + private Regex _type = new(@"([\b\Wу])(?<Type>длин)([\b\w\.\s])"); + + protected override string? BuildRhSolutionsName(string query) + { + var diameterMatches = _diameter.Matches(query); + if (diameterMatches.Count == 0) + { + return null; + } + var threadMatch = _thread.Match(query); + if (!threadMatch.Success) + { + return null; + } + var typeMatch = _type.Match(query); + 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}"; + } +}
\ No newline at end of file |