Changeset 1654 for trunk/sources/HeuristicLab.Persistence
- Timestamp:
- 04/24/09 14:21:54 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Persistence
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Core/Configuration.cs
r1623 r1654 22 22 } 23 23 24 public Configuration(IFormat format, Dictionary<Type,IFormatter> formatters, IEnumerable<IDecomposer> decomposers) {24 public Configuration(IFormat format, IEnumerable<IFormatter> formatters, IEnumerable<IDecomposer> decomposers) { 25 25 this.Format = format; 26 26 this.formatters = new Dictionary<Type, IFormatter>(); 27 foreach ( var pair in formatters) {28 if ( pair.Value.SerialDataType != format.SerialDataType) {27 foreach (IFormatter formatter in formatters) { 28 if (formatter.SerialDataType != format.SerialDataType) { 29 29 throw new ArgumentException("All formatters must have the same IFormat."); 30 30 } 31 this.formatters.Add( pair.Key, pair.Value);31 this.formatters.Add(formatter.SourceType, formatter); 32 32 } 33 33 this.decomposers = new List<IDecomposer>(decomposers); -
trunk/sources/HeuristicLab.Persistence/3.3/Core/ConfigurationService.cs
r1644 r1654 160 160 format.SerialDataType.VersionInvariantName())); 161 161 } 162 return new Configuration(format, formatterConfig , Decomposers.Where((d) => d.Priority > 0));162 return new Configuration(format, formatterConfig.Values, Decomposers.Where((d) => d.Priority > 0)); 163 163 } 164 164 -
trunk/sources/HeuristicLab.Persistence/UnitTests/UseCases.cs
r1653 r1654 379 379 XmlGenerator.Serialize(sdt, tempFile, 380 380 new Configuration(new XmlFormat(), 381 new Dictionary<Type, IFormatter> { 382 { typeof(string), new String2XmlFormatter() } }, 381 new List<IFormatter> { new String2XmlFormatter() }, 383 382 new List<IDecomposer> { 384 383 new StorableDecomposer(),
Note: See TracChangeset
for help on using the changeset viewer.