Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonItemConverterFactory.cs @ 17843

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

#3026

  • removed property ConvertableType from all converters
  • removed the option to fixate or loosen the path of JsonItems (obsolete)
  • added a abstract formatter SymbolicRegressionSolutionFormatterBase as base formatter for ISymbolicRegressionSolution
  • unified the construction of exporter controls
  • code cleanup
File size: 733 bytes
Line 
1using System;
2using System.Collections.Generic;
3using HeuristicLab.PluginInfrastructure;
4
5namespace HeuristicLab.JsonInterface {
6  public static class JsonItemConverterFactory {
7    private static IEnumerable<IJsonItemConverter> ConverterCache { get; set; }
8
9    public static JsonItemConverter Create() {
10      if (ConverterCache == null)
11        InitCache();
12      return new JsonItemConverter(ConverterCache);
13    }
14
15    private static void InitCache() {
16      IList<IJsonItemConverter> cache = new List<IJsonItemConverter>();
17      foreach (var converter in ApplicationManager.Manager.GetInstances<IJsonItemConverter>()) {
18        cache.Add(converter);
19      }
20      ConverterCache = cache;
21    }
22  }
23}
Note: See TracBrowser for help on using the repository browser.