- Timestamp:
- 10/01/19 12:58:25 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.Manufacture/Component.cs
r17275 r17280 9 9 10 10 namespace HeuristicLab.Manufacture { 11 //JsonItem 11 12 public class Component { 12 13 private IList<object> range; … … 23 24 } 24 25 } 25 public string Path { get; set; } 26 public string Path { get; set; } = ""; 26 27 27 28 public IList<object> Range { … … 43 44 44 45 [JsonIgnore] 45 public IList<Component> ParameterizedItems { get; set; }46 47 [JsonIgnore]48 46 public Component Reference { get; set; } 49 47 … … 56 54 target.Reference = from.Reference ?? target.Reference; 57 55 target.Parameters = from.Parameters ?? target.Parameters; 58 target.ParameterizedItems = from.ParameterizedItems ?? target.ParameterizedItems;59 56 target.Operators = from.Operators ?? target.Operators; 60 57 } … … 72 69 IsInNumericRange<double>(data.Default, data.Range[0], data.Range[1])); 73 70 71 72 73 public void UpdatePaths() { 74 if (Parameters != null) { 75 foreach (var p in Parameters) { 76 p.Path = Path + "." + p.Name; 77 } 78 } 79 80 if (Operators != null) { 81 foreach (var p in Operators) { 82 p.Path = Path + "." + p.Name; 83 } 84 } 85 } 86 87 public void PrependPath(string str) { 88 Path = $"{str}.{Path}"; 89 PrependPathHelper(Parameters, str); 90 PrependPathHelper(Operators, str); 91 } 92 93 private void PrependPathHelper(IEnumerable<Component> components, string str) { 94 if (components != null) { 95 foreach (var p in components) 96 p.PrependPath(str); 97 } 98 } 99 74 100 #region Helper 75 76 101 private static bool IsInRangeList(IEnumerable<object> list, object value) { 77 102 foreach (var x in list)
Note: See TracChangeset
for help on using the changeset viewer.