Changeset 1654
- Timestamp:
- 04/24/09 14:21:54 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence.GUI/3.3/PersistenceConfigurationForm.cs
r1642 r1654 376 376 if (formatterGrid == null || decomposerList == null) 377 377 return null; 378 var formatters = new Dictionary<Type,IFormatter>();378 var formatters = new List<IFormatter>(); 379 379 foreach (DataGridViewRow row in formatterGrid.Rows) { 380 380 if (row.Cells["Type"].Value != null && … … 382 382 row.Cells["Formatter"].Value != null && 383 383 (bool)row.Cells["Active"].Value == true) { 384 formatters.Add( 385 typeNameTable[(string)row.Cells["Type"].Value], 386 formatterTable[(string)row.Cells["Formatter"].Value]); 384 formatters.Add(formatterTable[(string)row.Cells["Formatter"].Value]); 387 385 } 388 386 } -
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.