Last change
on this file since 18040 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
|
Rev | Line | |
---|
[17394] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using HeuristicLab.PluginInfrastructure;
|
---|
| 4 |
|
---|
| 5 | namespace HeuristicLab.JsonInterface {
|
---|
| 6 | public static class JsonItemConverterFactory {
|
---|
[17843] | 7 | private static IEnumerable<IJsonItemConverter> ConverterCache { get; set; }
|
---|
[17394] | 8 |
|
---|
| 9 | public static JsonItemConverter Create() {
|
---|
| 10 | if (ConverterCache == null)
|
---|
| 11 | InitCache();
|
---|
| 12 | return new JsonItemConverter(ConverterCache);
|
---|
| 13 | }
|
---|
| 14 |
|
---|
| 15 | private static void InitCache() {
|
---|
[17843] | 16 | IList<IJsonItemConverter> cache = new List<IJsonItemConverter>();
|
---|
[17394] | 17 | foreach (var converter in ApplicationManager.Manager.GetInstances<IJsonItemConverter>()) {
|
---|
[17843] | 18 | cache.Add(converter);
|
---|
[17394] | 19 | }
|
---|
[17843] | 20 | ConverterCache = cache;
|
---|
[17394] | 21 | }
|
---|
| 22 | }
|
---|
| 23 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.