- Timestamp:
- 04/08/09 17:05:17 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Core/ConfigurationService.cs
r1539 r1542 7 7 using HeuristicLab.Persistence.Interfaces; 8 8 using HeuristicLab.Tracing; 9 using HeuristicLab.Persistence.Interfaces.Tokens; 9 10 10 11 namespace HeuristicLab.Persistence.Core { … … 14 15 private static ConfigurationService instance; 15 16 private readonly Dictionary<IFormat, Configuration> customConfigurations; 16 public readonly Dictionary<IFormat, List<IFormatter>> Formatters;17 public readonly List<IDecomposer> Decomposers;17 public Dictionary<IFormat, List<IFormatter>> Formatters { get; private set; } 18 public List<IDecomposer> Decomposers { get; private set; } 18 19 19 20 public static ConfigurationService Instance { … … 25 26 } 26 27 27 p ublicConfigurationService() {28 private ConfigurationService() { 28 29 Formatters = new Dictionary<IFormat, List<IFormatter>>(); 29 30 Decomposers = new List<IDecomposer>(); … … 35 36 public void LoadSettings() { 36 37 try { 37 if (String.IsNullOrEmpty(Properties.Settings.Default. customConfigurations) ||38 String.IsNullOrEmpty(Properties.Settings.Default. customConfigurationsTypeCache))38 if (String.IsNullOrEmpty(Properties.Settings.Default.CustomConfigurations) || 39 String.IsNullOrEmpty(Properties.Settings.Default.CustomConfigurationsTypeCache)) 39 40 return; 40 De Serializer deSerializer = new DeSerializer(41 Deserializer deSerializer = new Deserializer( 41 42 XmlParser.ParseTypeCache( 42 43 new StringReader( 43 Properties.Settings.Default. customConfigurationsTypeCache)));44 Properties.Settings.Default.CustomConfigurationsTypeCache))); 44 45 XmlParser parser = new XmlParser( 45 46 new StringReader( 46 Properties.Settings.Default. customConfigurations));47 Properties.Settings.Default.CustomConfigurations)); 47 48 var newCustomConfigurations = (Dictionary<IFormat, Configuration>) 48 deSerializer.De Serialize(parser);49 deSerializer.Deserialize(parser); 49 50 foreach (var config in newCustomConfigurations) { 50 51 customConfigurations[config.Key] = config.Value; … … 68 69 foreach (string s in generator.Format(serializer.TypeCache)) 69 70 configurationTypeCacheString.Append(s); 70 Properties.Settings.Default. customConfigurations =71 Properties.Settings.Default.CustomConfigurations = 71 72 configurationString.ToString(); 72 Properties.Settings.Default. customConfigurationsTypeCache =73 Properties.Settings.Default.CustomConfigurationsTypeCache = 73 74 configurationTypeCacheString.ToString(); 74 75 Properties.Settings.Default.Save();
Note: See TracChangeset
for help on using the changeset viewer.