Changeset 17481 for branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/IntervalRestrictedArrayJsonItem.cs
- Timestamp:
- 03/17/20 17:03:24 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/IntervalRestrictedArrayJsonItem.cs
r17477 r17481 12 12 public T Maximum { get; set; } 13 13 14 protected override bool Validate() { 15 foreach(var x in Value) { 16 if (Minimum.CompareTo(x) > 0 || Maximum.CompareTo(x) < 0) 17 return false; 14 protected override ValidationResult Validate() { 15 IList<string> errors = new List<string>(); 16 bool success = true; 17 foreach (var x in Value) { 18 if (Minimum.CompareTo(x) > 0 && Maximum.CompareTo(x) < 0) { 19 success = false; 20 errors.Add($"[{Path}]: Value {x} is not between {Minimum} and {Maximum}."); 21 } 18 22 } 19 return true;23 return new ValidationResult(success, errors); 20 24 } 21 25
Note: See TracChangeset
for help on using the changeset viewer.