- Timestamp:
- 09/26/19 10:14:35 (5 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.Manufacture/Component.cs
r17270 r17271 17 17 }*/ 18 18 19 public class ParameterData{19 public class Component { 20 20 public string Name { get; set; } 21 21 public string Type { get; set; } … … 24 24 public IList<object> Range { get; set; } 25 25 26 public IList< ParameterData> Parameters { get; set; }27 public IList< ParameterData> Operators { get; set; }26 public IList<Component> Parameters { get; set; } 27 public IList<Component> Operators { get; set; } 28 28 29 29 [JsonIgnore] 30 public ParameterDatathis[string index] {30 public Component this[string index] { 31 31 get { 32 32 if (Parameters == null) return null; … … 37 37 set { 38 38 if (Parameters == null) 39 Parameters = new List< ParameterData>();40 ParameterDatadata = this[index];39 Parameters = new List<Component>(); 40 Component data = this[index]; 41 41 if (data != null && CheckConstraints(value)) 42 42 Merge(data, value); … … 47 47 48 48 public override bool Equals(object obj) { 49 if (!(obj is ParameterData))49 if (!(obj is Component)) 50 50 return false; 51 51 else 52 return obj.Cast< ParameterData>().Name == this.Name;52 return obj.Cast<Component>().Name == this.Name; 53 53 } 54 54 … … 58 58 59 59 [JsonIgnore] 60 public IList< ParameterData> ParameterizedItems { get; set; }60 public IList<Component> ParameterizedItems { get; set; } 61 61 62 62 [JsonIgnore] 63 public ParameterDataReference { get; set; }63 public Component Reference { get; set; } 64 64 65 65 #region Helper 66 public static void Merge( ParameterData target, ParameterDatafrom) {66 public static void Merge(Component target, Component from) { 67 67 target.Name = from.Name ?? target.Name; 68 68 target.Type = from.Type ?? target.Type; … … 75 75 } 76 76 77 private bool CheckConstraints( ParameterDatadata) =>77 private bool CheckConstraints(Component data) => 78 78 data.Range != null && data.Default != null && ( 79 79 IsInRangeList(data.Range, data.Default) ||
Note: See TracChangeset
for help on using the changeset viewer.