Changeset 1566 for trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/DictionaryDecomposer.cs
- Timestamp:
- 04/16/09 12:58:14 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/DictionaryDecomposer.cs
r1563 r1566 5 5 using System.Collections.Generic; 6 6 7 namespace HeuristicLab.Persistence.Default.Decomposers { 8 7 namespace HeuristicLab.Persistence.Default.Decomposers { 8 9 9 [EmptyStorableClass] 10 10 public class DictionaryDecomposer : IDecomposer { … … 16 16 17 17 public bool CanDecompose(Type type) { 18 return type.GetInterface(typeof(IDictionary).FullName) != null; 18 return type.GetInterface(typeof(IDictionary).FullName) != null; 19 19 } 20 20 … … 24 24 25 25 public IEnumerable<Tag> Decompose(object o) { 26 IDictionary dict = (IDictionary)o; 27 foreach ( 26 IDictionary dict = (IDictionary)o; 27 foreach (DictionaryEntry entry in dict) { 28 28 yield return new Tag("key", entry.Key); 29 29 yield return new Tag("value", entry.Value); … … 43 43 Tag value = iter.Current; 44 44 dict.Add(key.Value, value.Value); 45 } 45 } 46 46 } 47 47 }
Note: See TracChangeset
for help on using the changeset viewer.