- Timestamp:
- 02/25/20 17:18:00 (5 years ago)
- Location:
- branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models
- Files:
-
- 1 added
- 4 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/DoubleJsonItems.cs
r17446 r17451 23 23 } 24 24 } 25 26 public class DoubleNamedMatrixJsonItem : NamedMatrixJsonItemBase<double> { 27 protected override bool IsInRange() { 28 for (int c = 0; c < Value.Length; ++c) { 29 for (int r = 0; r < Value[c].Length; ++r) { 30 if (Value[c][r] < Range.First() && Range.Last() < Value[c][r]) 31 return false; 32 } 33 } 34 return true; 35 } 36 } 25 37 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/IntJsonItems.cs
r17446 r17451 6 6 7 7 namespace HeuristicLab.JsonInterface { 8 public class IntJsonItem : JsonItem<int> { } 8 public class IntJsonItem : JsonItem<int> { 9 /*I 10 public int MinValue { get; set; } 11 public int MaxValue { get; set; } 12 */ 13 } 9 14 public class IntArrayJsonItem : ArrayJsonItemBase<int> { } 10 15 public class IntRangeJsonItem : ArrayJsonItemBase<int> { -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/JsonItem.cs
r17446 r17451 66 66 public virtual IEnumerable<object> Range { get; set; } 67 67 68 // TODO eigene items für LookUp? 68 69 public virtual string ActualName { get; set; } 70 71 // TODO jsonIgnore dataType? 69 72 70 73 [JsonIgnore] … … 73 76 [JsonIgnore] 74 77 public virtual IJsonItem Parent { get; set; } 78 79 [JsonIgnore] 80 public virtual bool Active { get; set; } 75 81 76 82 #region Constructors … … 81 87 } 82 88 #endregion 83 84 #region Public Static Methods 85 public static void Merge(JsonItem target, JsonItem from) { 86 target.Name = from.Name ?? target.Name; 87 target.Range = from.Range ?? target.Range; 88 target.Value = from.Value ?? target.Value; 89 target.ActualName = from.ActualName ?? target.ActualName; 90 if(target.Children != null) { 91 if (from.Children != null) 92 ((List<IJsonItem>)from.Children).AddRange(target.Children); 93 } else { 94 target.Children = from.Children; 95 } 96 } 97 #endregion 98 89 99 90 #region Public Methods 100 91 public void AddChildren(params IJsonItem[] childs) => … … 124 115 125 116 #region Helper 117 /* 118 * TODO protected abstract bool Validate(); 119 */ 120 126 121 protected virtual bool IsInRange() { 127 122 bool b1 = true, b2 = true; -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/ResultJsonItem.cs
r17450 r17451 6 6 7 7 namespace HeuristicLab.JsonInterface { 8 public class Result Item : JsonItem {8 public class ResultJsonItem : JsonItem { 9 9 10 10 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/StringJsonItem.cs
r17446 r17451 7 7 namespace HeuristicLab.JsonInterface { 8 8 public class StringJsonItem : JsonItem<string> { } 9 public class StringArrayJsonItem : JsonItem<string[], string> { } 9 10 }
Note: See TracChangeset
for help on using the changeset viewer.