- Timestamp:
- 05/15/09 12:29:13 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers
- Files:
-
- 11 deleted
- 3 edited
- 11 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/ArraySerializer.cs
r1805 r1823 3 3 using HeuristicLab.Persistence.Interfaces; 4 4 using System.Collections.Generic; 5 using HeuristicLab.Persistence.Default. Decomposers.Storable;5 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 6 6 7 namespace HeuristicLab.Persistence.Default. Decomposers {7 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 8 8 9 9 [EmptyStorableClass] 10 public class Array Decomposer : IDecomposer {10 public class ArraySerializer : ICompositeSerializer { 11 11 12 12 public int Priority { … … 14 14 } 15 15 16 public bool Can Decompose(Type type) {16 public bool CanSerialize(Type type) { 17 17 return type.IsArray || type == typeof(Array); 18 18 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/CompactNumberArray2StringSerializer.cs
r1805 r1823 6 6 using System.Globalization; 7 7 using System.Text; 8 using HeuristicLab.Persistence.Default. Decomposers.Storable;8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 9 10 namespace HeuristicLab.Persistence.Default. Decomposers {10 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 11 11 12 12 [EmptyStorableClass] 13 public class CompactNumberArray2String Decomposer : IDecomposer {13 public class CompactNumberArray2StringSerializer : ICompositeSerializer { 14 14 15 15 public int Priority { … … 17 17 } 18 18 19 private static readonly Number2String Decomposer numberConverter =20 new Number2String Decomposer();19 private static readonly Number2StringSerializer numberConverter = 20 new Number2StringSerializer(); 21 21 22 public bool Can Decompose(Type type) {22 public bool CanSerialize(Type type) { 23 23 return 24 24 (type.IsArray || type == typeof(Array)) && 25 numberConverter.Can Decompose(type.GetElementType());25 numberConverter.CanSerialize(type.GetElementType()); 26 26 } 27 27 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/DictionarySerializer.cs
r1805 r1823 4 4 using HeuristicLab.Persistence.Interfaces; 5 5 using System.Collections.Generic; 6 using HeuristicLab.Persistence.Default. Decomposers.Storable;6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 using HeuristicLab.Persistence.Auxiliary; 8 8 9 namespace HeuristicLab.Persistence.Default. Decomposers {9 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 10 10 11 11 [EmptyStorableClass] 12 public class Dictionary Decomposer : IDecomposer {12 public class DictionarySerializer : ICompositeSerializer { 13 13 14 14 public int Priority { … … 17 17 18 18 19 public bool Can Decompose(Type type) {19 public bool CanSerialize(Type type) { 20 20 return ReflectionTools.HasDefaultConstructor(type) && 21 21 type.GetInterface(typeof(IDictionary).FullName) != null; -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/EnumSerializer.cs
r1805 r1823 3 3 using HeuristicLab.Persistence.Interfaces; 4 4 using System.Collections.Generic; 5 using HeuristicLab.Persistence.Default. Decomposers.Storable;5 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 6 6 7 namespace HeuristicLab.Persistence.Default. Decomposers {7 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 8 8 9 9 [EmptyStorableClass] 10 public class Enum Decomposer : IDecomposer {10 public class EnumSerializer : ICompositeSerializer { 11 11 12 12 public int Priority { … … 14 14 } 15 15 16 public bool Can Decompose(Type type) {16 public bool CanSerialize(Type type) { 17 17 return type.IsEnum || type == typeof(Enum); 18 18 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/EnumerableSerializer.cs
r1805 r1823 5 5 using HeuristicLab.Persistence.Interfaces; 6 6 using System.Collections.Generic; 7 using HeuristicLab.Persistence.Default. Decomposers.Storable;7 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 8 8 using HeuristicLab.Persistence.Auxiliary; 9 9 10 namespace HeuristicLab.Persistence.Default. Decomposers {10 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 11 11 12 12 [EmptyStorableClass] 13 public class Enumerable Decomposer : IDecomposer {13 public class EnumerableSerializer : ICompositeSerializer { 14 14 15 15 public int Priority { … … 18 18 19 19 20 public bool Can Decompose(Type type) {20 public bool CanSerialize(Type type) { 21 21 return 22 22 ReflectionTools.HasDefaultConstructor(type) && -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/KeyValuePairSerializer.cs
r1805 r1823 5 5 using HeuristicLab.Persistence.Interfaces; 6 6 using System.Reflection; 7 using HeuristicLab.Persistence.Default. Decomposers.Storable;7 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 8 8 9 namespace HeuristicLab.Persistence.Default. Decomposers {9 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 10 10 11 11 [EmptyStorableClass] 12 public class KeyValuePair Decomposer : IDecomposer {12 public class KeyValuePairSerializer : ICompositeSerializer { 13 13 14 14 public int Priority { … … 17 17 18 18 19 public bool Can Decompose(Type type) {19 public bool CanSerialize(Type type) { 20 20 return type.IsGenericType && 21 21 type.GetGenericTypeDefinition() == -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Number2StringSerializer.cs
r1805 r1823 8 8 using System.Text; 9 9 10 namespace HeuristicLab.Persistence.Default. Decomposers {10 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 11 11 12 public class Number2String Decomposer : IDecomposer {12 public class Number2StringSerializer : ICompositeSerializer { 13 13 14 14 private static readonly List<Type> numberTypes = … … 30 30 private static readonly Dictionary<Type, MethodInfo> numberParsers; 31 31 32 static Number2String Decomposer() {32 static Number2StringSerializer() { 33 33 numberParsers = new Dictionary<Type, MethodInfo>(); 34 34 foreach (var type in numberTypes) { … … 39 39 } 40 40 41 public bool Can Decompose(Type type) {41 public bool CanSerialize(Type type) { 42 42 return numberParsers.ContainsKey(type); 43 43 } … … 66 66 } 67 67 68 69 #region IDecomposer Members70 68 71 69 public int Priority { … … 99 97 // numbers are composed just of meta info, no need to populate 100 98 } 101 102 #endregion103 99 } 104 105 100 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/NumberEnumerable2StringSerializer.cs
r1805 r1823 6 6 using System.Globalization; 7 7 using System.Text; 8 using HeuristicLab.Persistence.Default. Decomposers.Storable;8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 9 using HeuristicLab.Persistence.Auxiliary; 10 10 11 namespace HeuristicLab.Persistence.Default. Decomposers {11 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 12 12 13 13 [EmptyStorableClass] 14 public class NumberEnumerable2String Decomposer : IDecomposer {14 public class NumberEnumerable2StringSerializer : ICompositeSerializer { 15 15 16 16 public int Priority { … … 18 18 } 19 19 20 private static readonly Number2String Decomposer numberConverter =21 new Number2String Decomposer();20 private static readonly Number2StringSerializer numberConverter = 21 new Number2StringSerializer(); 22 22 23 23 private static readonly Dictionary<Type, Type> interfaceCache = new Dictionary<Type, Type>(); … … 29 29 if (iface.IsGenericType && 30 30 iface.GetGenericTypeDefinition() == typeof(IEnumerable<>) && 31 numberConverter.Can Decompose(iface.GetGenericArguments()[0])) {31 numberConverter.CanSerialize(iface.GetGenericArguments()[0])) { 32 32 interfaceCache.Add(type, iface); 33 33 return iface; … … 53 53 } 54 54 55 public bool Can Decompose(Type type) {55 public bool CanSerialize(Type type) { 56 56 return 57 57 ReflectionTools.HasDefaultConstructor(type) && -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/StackSerializer.cs
r1805 r1823 5 5 using HeuristicLab.Persistence.Interfaces; 6 6 using System.Collections.Generic; 7 using HeuristicLab.Persistence.Default. Decomposers.Storable;7 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 8 8 using System.IO; 9 9 10 namespace HeuristicLab.Persistence.Default. Decomposers {10 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 11 11 12 12 [EmptyStorableClass] 13 public class Stack Decomposer : IDecomposer {13 public class StackSerializer : ICompositeSerializer { 14 14 15 15 public int Priority { … … 18 18 19 19 20 public bool Can Decompose(Type type) {20 public bool CanSerialize(Type type) { 21 21 return type == typeof(Stack) || 22 22 type.IsGenericType && -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/DataMemberAccessor.cs
r1625 r1823 3 3 using HeuristicLab.Persistence.Core; 4 4 5 namespace HeuristicLab.Persistence.Default. Decomposers.Storable {5 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable { 6 6 7 7 public class DataMemberAccessor { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/EmptyStorableClassAttribute.cs
r1652 r1823 3 3 using System.Reflection; 4 4 5 namespace HeuristicLab.Persistence.Default. Decomposers.Storable {5 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable { 6 6 7 7 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableAttribute.cs
r1623 r1823 3 3 using System.Reflection; 4 4 5 namespace HeuristicLab.Persistence.Default. Decomposers.Storable {5 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable { 6 6 7 7 [AttributeUsage( -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableSerializer.cs
r1805 r1823 7 7 using HeuristicLab.Persistence.Auxiliary; 8 8 9 namespace HeuristicLab.Persistence.Default. Decomposers.Storable {9 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable { 10 10 11 11 [EmptyStorableClass] 12 public class Storable Decomposer : IDecomposer {12 public class StorableSerializer : ICompositeSerializer { 13 13 14 14 public int Priority { … … 16 16 } 17 17 18 public bool Can Decompose(Type type) {18 public bool CanSerialize(Type type) { 19 19 return ReflectionTools.HasDefaultConstructor(type) && 20 20 (StorableAttribute.GetStorableMembers(type, false).Count() > 0 || -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/TypeSerializer.cs
r1805 r1823 4 4 using HeuristicLab.Persistence.Interfaces; 5 5 using System.Collections.Generic; 6 using HeuristicLab.Persistence.Default. Decomposers.Storable;6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 8 namespace HeuristicLab.Persistence.Default. Decomposers {8 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 9 9 10 10 [EmptyStorableClass] 11 public class Type Decomposer : IDecomposer {11 public class TypeSerializer : ICompositeSerializer { 12 12 13 13 public int Priority { … … 15 15 } 16 16 17 public bool Can Decompose(Type type) {17 public bool CanSerialize(Type type) { 18 18 return type == typeof(Type) || 19 19 type.VersionInvariantName() == "System.RuntimeType, mscorlib";
Note: See TracChangeset
for help on using the changeset viewer.