using System; using System.Collections.Generic; using HeuristicLab.PluginInfrastructure; namespace HeuristicLab.JsonInterface { public static class JsonItemConverterFactory { private static IDictionary ConverterCache { get; set; } public static JsonItemConverter Create() { if (ConverterCache == null) InitCache(); return new JsonItemConverter(ConverterCache); } private static void InitCache() { ConverterCache = new Dictionary(); foreach (var converter in ApplicationManager.Manager.GetInstances()) { ConverterCache.Add(converter.ConvertableType, converter); } } } }