Soil anchor was added

This commit is contained in:
ear
2023-12-01 20:07:26 +05:00
parent 01e6f97429
commit 8de8c00182
10 changed files with 461 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace StructureHelperCommon.Services
{
@@ -43,5 +44,12 @@ namespace StructureHelperCommon.Services
throw new StructureHelperException($"{ErrorStrings.ExpectedWas(targetType, sourceObject.GetType())}");
}
}
public static void CheckMinMax (double value, double minValue, double maxValue)
{
if (value == null || minValue == null || maxValue == null) { throw new StructureHelperException(ErrorStrings.NullReference); }
if (value < minValue) { throw new StructureHelperException($"{ErrorStrings.IncorrectValue}: Value must be greater than {minValue}"); }
if (value > maxValue) { throw new StructureHelperException($"{ErrorStrings.IncorrectValue}: Value must be less than {maxValue}"); }
}
}
}