blob: 30b35c313600fd7185e553030e69d51d45d2b99f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
using System.Text.RegularExpressions;
namespace RhSolutions.MLModifiers.DrinkingWaterHeatingFittings;
[MLModifierKey("Тройник RAUTITAN резьбовой наружный")]
public class ThreadTPieceExternal : DrinkingWaterHeatingFitting
{
protected override string _title => "Тройник с наружной резьбой";
public override bool TryQueryModify(string input, out string output)
{
output = string.Empty;
MatchCollection diametersMatches = _diameter.Matches(input);
if (diametersMatches.Count == 0)
{
return false;
}
string thread = _thread.Match(input).Groups["Thread"].Value;
int[] diameters = diametersMatches.Select(match => int.Parse(match.Groups["Diameter"].Value)).ToArray();
if (diameters.Length == 1)
{
output = $"{_title} {diameters[0]}-{diameters[0]}-R {thread}";
}
else
{
output = $"{_title} {diameters[0]}-{diameters[1]}-R {thread}";
}
return true;
}
}
|