- Timestamp:
- 04/16/09 12:40:41 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Core/Configuration.cs
r1542 r1564 9 9 [Storable] 10 10 private readonly Dictionary<Type, IFormatter> formatters; 11 11 12 [Storable] 12 13 private readonly List<IDecomposer> decomposers; 13 14 private readonly Dictionary<Type, IDecomposer> decomposerCache; 14 [Storable] 15 public IFormat Format { get; set; } 15 16 [Storable] 17 public IFormat Format { get; private set; } 16 18 17 19 private Configuration() { … … 19 21 } 20 22 21 public Configuration(Dictionary<Type, IFormatter> formatters, IEnumerable<IDecomposer> decomposers) { 23 public Configuration(IFormat format, Dictionary<Type, IFormatter> formatters, IEnumerable<IDecomposer> decomposers) { 24 this.Format = format; 22 25 this.formatters = new Dictionary<Type, IFormatter>(); 23 26 foreach ( var pair in formatters ) { 24 if (Format == null) { 25 Format = pair.Value.Format; 26 } else if (pair.Value.Format != Format ) { 27 if (pair.Value.SerialDataType != format.SerialDataType ) { 27 28 throw new ArgumentException("All formatters must have the same IFormat."); 28 29 }
Note: See TracChangeset
for help on using the changeset viewer.