Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/StringValueVM.cs @ 17842

Last change on this file since 17842 was 17828, checked in by dpiringe, 4 years ago

#3026

  • removed the option to set the value for JsonItems via exporter
    • reworked some base controls
    • added new controls for JsonItem specific properties (e.g. ArrayResizable)
    • deleted a lot of obsolet controls
  • removed the Enable checkbox in the detail view of JsonItems
  • exporter now clones the IOptimizer object
  • added a check + message for unsupported exports
  • list of JsonItems now includes unsupported JsonItems (disabled and marked with 'unsupported')
  • refactored the converter type check
    • now every converter has to specify its supported type(s)
File size: 620 bytes
Line 
1using System.Linq;
2
3namespace HeuristicLab.JsonInterface.OptimizerIntegration {
4
5  public class StringValueVM : ConcreteRestrictedJsonItemVM<StringJsonItem, string, string> {
6    protected override string GetDefaultValue() => Range.FirstOrDefault();
7
8    protected override bool RangeContainsValue() => Range.Contains(Value);
9  }
10
11  public class StringArrayVM : ConcreteRestrictedJsonItemVM<StringArrayJsonItem, string, string[]> {
12    protected override string[] GetDefaultValue() => Range.ToArray();
13
14    protected override bool RangeContainsValue() => Value.All(x => Range.Any(y => x == y));
15  }
16}
Note: See TracBrowser for help on using the repository browser.