Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/MacroStabilityInwardsGrid.cs =================================================================== diff -u -r7472a3a034f5d43d665980b35727c63d167abb5e -r11f07beedffdae5eee71141830eb73827dd3ae94 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/MacroStabilityInwardsGrid.cs (.../MacroStabilityInwardsGrid.cs) (revision 7472a3a034f5d43d665980b35727c63d167abb5e) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/MacroStabilityInwardsGrid.cs (.../MacroStabilityInwardsGrid.cs) (revision 11f07beedffdae5eee71141830eb73827dd3ae94) @@ -21,6 +21,7 @@ using System; using Core.Common.Base.Data; +using Ringtoets.MacroStabilityInwards.Data.Properties; namespace Ringtoets.MacroStabilityInwards.Data { @@ -29,10 +30,14 @@ /// public class MacroStabilityInwardsGrid : ICloneable { + private static readonly Range numberOfPointsValidityRange = new Range(1, 100); + private RoundedDouble xLeft; private RoundedDouble xRight; private RoundedDouble zTop; private RoundedDouble zBottom; + private int numberOfHorizontalPoints; + private int numberOfVerticalPoints; /// /// Creates a new instance of . @@ -47,6 +52,9 @@ this.xRight = new RoundedDouble(2, xRight); this.zTop = new RoundedDouble(2, zTop); this.zBottom = new RoundedDouble(2, zBottom); + + NumberOfHorizontalPoints = 5; + NumberOfVerticalPoints = 5; } /// @@ -116,13 +124,49 @@ /// /// Gets or set the number of horizontal points. /// - public int NumberOfHorizontalPoints { get; set; } + /// Thrown when value is not in range [1, 100]. + public int NumberOfHorizontalPoints + { + get + { + return numberOfHorizontalPoints; + } + set + { + if (!numberOfPointsValidityRange.InRange(value)) + { + string message = string.Format(Resources.NumberOfHorizontalPoints_must_be_in_Range_0_, + numberOfPointsValidityRange); + throw new ArgumentOutOfRangeException(nameof(value), message); + } + numberOfHorizontalPoints = value; + } + } + /// /// Gets or sets the number of vertical points. /// - public int NumberOfVerticalPoints { get; set; } + /// Thrown when value is not in range [1, 100]. + public int NumberOfVerticalPoints + { + get + { + return numberOfVerticalPoints; + } + set + { + if (!numberOfPointsValidityRange.InRange(value)) + { + string message = string.Format(Resources.NumberOfVerticalPoints_must_be_in_Range_0_, + numberOfPointsValidityRange); + throw new ArgumentOutOfRangeException(nameof(value), message); + } + numberOfVerticalPoints = value; + } + } + public object Clone() { return MemberwiseClone();