- Timestamp:
- 03/25/09 17:15:42 (16 years ago)
- Location:
- branches/New Persistence Exploration/Persistence/Persistence/Core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/New Persistence Exploration/Persistence/Persistence/Core/Configuration.cs
r1406 r1418 15 15 public readonly IFormat Format; 16 16 17 private Configuration() {} 17 private Configuration() { 18 decomposerCache = new Dictionary<Type, IDecomposer>(); 19 } 18 20 19 21 public Configuration(Dictionary<Type, IFormatter> formatters, IEnumerable<IDecomposer> decomposers) { -
branches/New Persistence Exploration/Persistence/Persistence/Core/ConfigurationService.cs
r1406 r1418 35 35 36 36 public void LoadSettings() { 37 if ( String.IsNullOrEmpty(Properties.Settings.Default.customConfigurations) || 38 String.IsNullOrEmpty(Properties.Settings.Default.customConfigurationsTypeCache) ) 39 return; 40 DeSerializer deSerializer = new DeSerializer( 41 XmlParser.ParseTypeCache( 42 new StringReader( 43 Properties.Settings.Default.customConfigurationsTypeCache))); 44 XmlParser parser = new XmlParser( 45 new StringReader( 46 Properties.Settings.Default.customConfigurations)); 47 var newCustomConfigurations = (Dictionary<IFormat, Configuration>) 48 deSerializer.DeSerialize(parser); 49 foreach ( var config in newCustomConfigurations ) { 50 customConfigurations[config.Key] = config.Value; 37 try { 38 if (String.IsNullOrEmpty(Properties.Settings.Default.customConfigurations) || 39 String.IsNullOrEmpty(Properties.Settings.Default.customConfigurationsTypeCache)) 40 return; 41 DeSerializer deSerializer = new DeSerializer( 42 XmlParser.ParseTypeCache( 43 new StringReader( 44 Properties.Settings.Default.customConfigurationsTypeCache))); 45 XmlParser parser = new XmlParser( 46 new StringReader( 47 Properties.Settings.Default.customConfigurations)); 48 var newCustomConfigurations = (Dictionary<IFormat, Configuration>) 49 deSerializer.DeSerialize(parser); 50 foreach (var config in newCustomConfigurations) { 51 customConfigurations[config.Key] = config.Value; 52 } 53 } catch { 54 Console.WriteLine("WARNING: Could not load settings."); 51 55 } 52 56 }
Note: See TracChangeset
for help on using the changeset viewer.