Changeset 1539 for trunk/sources/HeuristicLab.Persistence
- Timestamp:
- 04/08/09 11:03:36 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Persistence/3.3
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Core/ConfigurationService.cs
r1473 r1539 84 84 if ( a != defaultAssembly ) 85 85 DiscoverFrom(a); 86 SortDecomposers(); 87 } 88 89 class PriortiySorter : IComparer<IDecomposer> { 90 public int Compare(IDecomposer x, IDecomposer y) { 91 return y.Priority - x.Priority; 92 } 93 } 94 95 protected void SortDecomposers() { 96 Decomposers.Sort(new PriortiySorter()); 86 97 } 87 98 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/ArrayDecomposer.cs
r1518 r1539 7 7 8 8 public class ArrayDecomposer : IDecomposer { 9 10 public int Priority { 11 get { return 100; } 12 } 9 13 10 14 public bool CanDecompose(Type type) { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/DictionaryDecomposer.cs
r1454 r1539 41 41 public class DictionaryDecomposer : IDecomposer { 42 42 43 public int Priority { 44 get { return 100; } 45 } 46 47 43 48 public bool CanDecompose(Type type) { 44 49 return type.GetInterface(typeof(IDictionary).FullName) != null; -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/EnumDecomposer.cs
r1456 r1539 7 7 8 8 public class EnumDecomposer : IDecomposer { 9 10 public int Priority { 11 get { return 100; } 12 } 9 13 10 14 public bool CanDecompose(Type type) { … … 25 29 return Enum.Parse(t, (string)it.Current.Value); 26 30 } 31 27 32 } 28 33 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/EnumerableDecomposer.cs
r1454 r1539 49 49 } 50 50 51 public class EnumerableDecomposer : IDecomposer { 51 public class EnumerableDecomposer : IDecomposer { 52 53 public int Priority { 54 get { return 100; } 55 } 56 52 57 53 58 public bool CanDecompose(Type type) { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/KeyValuePairDecomposer.cs
r1454 r1539 8 8 namespace HeuristicLab.Persistence.Default.Decomposers { 9 9 10 public class KeyValuePairDecomposer : IDecomposer { 10 public class KeyValuePairDecomposer : IDecomposer { 11 12 public int Priority { 13 get { return 100; } 14 } 15 11 16 12 17 public bool CanDecompose(Type type) { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/StorableDecomposer.cs
r1454 r1539 7 7 namespace HeuristicLab.Persistence.Default.Decomposers { 8 8 9 public class StorableDecomposer : IDecomposer { 9 public class StorableDecomposer : IDecomposer { 10 11 public int Priority { 12 get { return 200; } 13 } 10 14 11 15 public bool CanDecompose(Type type) { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/TypeDecomposer.cs
r1454 r1539 6 6 namespace HeuristicLab.Persistence.Default.Decomposers { 7 7 8 public class TypeDecomposer : IDecomposer { 8 public class TypeDecomposer : IDecomposer { 9 10 public int Priority { 11 get { return 100; } 12 } 13 9 14 public bool CanDecompose(Type type) { 10 15 return type == typeof (Type) || -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/X2StringDecomposer.cs
r1518 r1539 10 10 11 11 public class Number2StringDecomposer : IDecomposer { 12 13 public int Priority { 14 get { return 100; } 15 } 16 12 17 13 18 private static readonly List<Type> numberTypes = … … 77 82 public class DateTime2StringDecomposer : IDecomposer { 78 83 84 public int Priority { 85 get { return 100; } 86 } 87 88 79 89 public bool CanDecompose(Type type) { 80 90 return type == typeof(DateTime); … … 99 109 100 110 public class CompactNumberArray2StringDecomposer : IDecomposer { 111 112 public int Priority { 113 get { return 200; } 114 } 101 115 102 116 private static readonly Number2StringDecomposer numberDecomposer = … … 183 197 184 198 public class NumberEnumerable2StringDecomposer : IDecomposer { 199 200 public int Priority { 201 get { return 200; } 202 } 185 203 186 204 private static readonly Number2StringDecomposer numberDecomposer = -
trunk/sources/HeuristicLab.Persistence/3.3/Interfaces/IDecomposer.cs
r1454 r1539 6 6 7 7 public interface IDecomposer { 8 9 /// <summary> 10 /// Defines the Priorty of this Decomposer. Higher number means 11 /// higher prioriy. Negative numbers are fallback decomposers. 12 /// All default generic decomposers have priority 100. Specializations 13 /// have priority 200 so they will be tried first. Priorities are 14 /// only considered for default configurations. 15 /// </summary> 16 int Priority { get; } 8 17 9 18 /// <summary>
Note: See TracChangeset
for help on using the changeset viewer.