- Timestamp:
- 04/16/09 12:58:14 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Core/Configuration.cs
r1564 r1566 14 14 private readonly Dictionary<Type, IDecomposer> decomposerCache; 15 15 16 [Storable] 16 [Storable] 17 17 public IFormat Format { get; private set; } 18 18 … … 24 24 this.Format = format; 25 25 this.formatters = new Dictionary<Type, IFormatter>(); 26 foreach ( var pair in formatters) {27 if (pair.Value.SerialDataType != format.SerialDataType 26 foreach (var pair in formatters) { 27 if (pair.Value.SerialDataType != format.SerialDataType) { 28 28 throw new ArgumentException("All formatters must have the same IFormat."); 29 29 } … … 31 31 } 32 32 this.decomposers = new List<IDecomposer>(decomposers); 33 decomposerCache = new Dictionary<Type, IDecomposer>(); 33 decomposerCache = new Dictionary<Type, IDecomposer>(); 34 34 } 35 35 … … 42 42 } 43 43 44 public IFormatter GetFormatter(Type type) { 44 public IFormatter GetFormatter(Type type) { 45 45 IFormatter formatter; 46 46 formatters.TryGetValue(type, out formatter); … … 50 50 public IDecomposer GetDecomposer(Type type) { 51 51 if (decomposerCache.ContainsKey(type)) 52 return decomposerCache[type]; 52 return decomposerCache[type]; 53 53 foreach (IDecomposer d in decomposers) { 54 54 if (d.CanDecompose(type)) { … … 59 59 decomposerCache.Add(type, null); 60 60 return null; 61 } 62 } 63 61 } 62 } 63 64 64 }
Note: See TracChangeset
for help on using the changeset viewer.