Changeset 4068 for trunk/sources/HeuristicLab.Persistence/3.3/Default
- Timestamp:
- 07/22/10 00:44:01 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Persistence/3.3/Default
- Files:
-
- 73 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/ArraySerializer.cs
r3742 r4068 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using HeuristicLab.Persistence.Core; 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 26 using HeuristicLab.Persistence.Interfaces; 25 using System.Collections.Generic;26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;27 using System.Text;28 27 29 28 namespace HeuristicLab.Persistence.Default.CompositeSerializers { … … 96 95 } 97 96 return Array.CreateInstance(t.GetElementType(), lengths, lowerBounds); 98 } catch (InvalidOperationException x) { 97 } 98 catch (InvalidOperationException x) { 99 99 throw new PersistenceException("Insufficient meta information to construct array instance.", x); 100 } catch (InvalidCastException x) { 100 } 101 catch (InvalidCastException x) { 101 102 throw new PersistenceException("Invalid format of array metainfo.", x); 102 103 } … … 129 130 } 130 131 } 131 } catch (InvalidOperationException x) { 132 } 133 catch (InvalidOperationException x) { 132 134 throw new PersistenceException("Insufficient data to fill array instance", x); 133 } catch (InvalidCastException x) { 135 } 136 catch (InvalidCastException x) { 134 137 throw new PersistenceException("Invalid element data. Cannot fill array", x); 135 } catch (IndexOutOfRangeException x) { 138 } 139 catch (IndexOutOfRangeException x) { 136 140 throw new PersistenceException("Too many elements during array deserialization", x); 137 141 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/CompactNumberArray2StringSerializer.cs
r3946 r4068 21 21 22 22 using System; 23 using System.Linq; 23 using System.Collections.Generic; 24 using System.Text; 25 using HeuristicLab.Persistence.Auxiliary; 26 using HeuristicLab.Persistence.Core; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 28 using HeuristicLab.Persistence.Interfaces; 25 using HeuristicLab.Persistence.Core;26 using System.Collections.Generic;27 using System.Reflection;28 using System.Globalization;29 using System.Text;30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;31 using HeuristicLab.Persistence.Auxiliary;32 29 33 30 namespace HeuristicLab.Persistence.Default.CompositeSerializers { … … 143 140 } 144 141 return a; 145 } catch (InvalidOperationException e) { 142 } 143 catch (InvalidOperationException e) { 146 144 throw new PersistenceException("Insuffictient data to deserialize compact array", e); 147 } catch (InvalidCastException e) { 145 } 146 catch (InvalidCastException e) { 148 147 throw new PersistenceException("Invalid element data during compact array deserialization", e); 149 148 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/DictionarySerializer.cs
r3742 r4068 22 22 using System; 23 23 using System.Collections; 24 using System.Collections.Generic; 25 using HeuristicLab.Persistence.Auxiliary; 24 26 using HeuristicLab.Persistence.Core; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 28 using HeuristicLab.Persistence.Interfaces; 26 using System.Collections.Generic;27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;28 using HeuristicLab.Persistence.Auxiliary;29 29 30 30 namespace HeuristicLab.Persistence.Default.CompositeSerializers { … … 75 75 dict.Add(key.Value, value.Value); 76 76 } 77 } catch (InvalidOperationException e) { 77 } 78 catch (InvalidOperationException e) { 78 79 throw new PersistenceException("Dictionaries must contain an even number of elements (key+value).", e); 79 } catch (NotSupportedException e) { 80 } 81 catch (NotSupportedException e) { 80 82 throw new PersistenceException("The serialized dictionary type was read-only or had a fixed size and cannot be deserialized.", e); 81 } catch (ArgumentNullException e) { 83 } 84 catch (ArgumentNullException e) { 82 85 throw new PersistenceException("Dictionary key was null.", e); 83 } catch (ArgumentException e) { 86 } 87 catch (ArgumentException e) { 84 88 throw new PersistenceException("Duplicate dictionary key.", e); 85 89 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/EnumSerializer.cs
r3742 r4068 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using HeuristicLab.Persistence.Core; 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 26 using HeuristicLab.Persistence.Interfaces; 25 using System.Collections.Generic;26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;27 27 28 28 namespace HeuristicLab.Persistence.Default.CompositeSerializers { … … 56 56 it.MoveNext(); 57 57 return Enum.Parse(t, (string)it.Current.Value); 58 } catch (InvalidOperationException e) { 58 } 59 catch (InvalidOperationException e) { 59 60 throw new PersistenceException("not enough meta information to recstruct enum", e); 60 } catch (InvalidCastException e) { 61 } 62 catch (InvalidCastException e) { 61 63 throw new PersistenceException("invalid meta information found while trying to reconstruct enum", e); 62 64 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/EnumerableSerializer.cs
r3742 r4068 22 22 using System; 23 23 using System.Collections; 24 using System.Collections.Generic; 24 25 using System.Reflection; 26 using HeuristicLab.Persistence.Auxiliary; 25 27 using HeuristicLab.Persistence.Core; 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 29 using HeuristicLab.Persistence.Interfaces; 27 using System.Collections.Generic;28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;29 using HeuristicLab.Persistence.Auxiliary;30 30 31 31 namespace HeuristicLab.Persistence.Default.CompositeSerializers { … … 53 53 return "interface IEnumerable not implemented"; 54 54 if (type.GetMethod("Add") == null) 55 return "no 'Add()' method"; 55 return "no 'Add()' method"; 56 56 return "no 'Add()' method with one argument"; 57 57 } … … 76 76 foreach (var tag in tags) 77 77 addMethod.Invoke(instance, new[] { tag.Value }); 78 } catch (Exception e) { 78 } 79 catch (Exception e) { 79 80 throw new PersistenceException("Exception caught while trying to populate enumerable.", e); 80 81 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/KeyValuePairSerializer.cs
r3742 r4068 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using System.Linq; 24 using System. Collections.Generic;25 using System.Reflection; 25 26 using HeuristicLab.Persistence.Core; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 28 using HeuristicLab.Persistence.Interfaces; 27 using System.Reflection;28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;29 29 30 30 namespace HeuristicLab.Persistence.Default.CompositeSerializers { … … 42 42 public bool CanSerialize(Type type) { 43 43 return type.IsGenericType && 44 type.GetGenericTypeDefinition() == genericKeyValuePairType; 44 type.GetGenericTypeDefinition() == genericKeyValuePairType; 45 45 } 46 46 47 47 public string JustifyRejection(Type type) { 48 48 if (!type.IsGenericType) 49 return "not even generic"; 49 return "not even generic"; 50 50 return "not generic KeyValuePair<,>"; 51 51 } … … 60 60 try { 61 61 key = new Tag("key", t.GetProperty("Key").GetValue(o, null)); 62 } catch (Exception e) { 62 } 63 catch (Exception e) { 63 64 throw new PersistenceException("Exception caught during KeyValuePair decomposition", e); 64 65 } … … 66 67 try { 67 68 value = new Tag("value", t.GetProperty("Value").GetValue(o, null)); 68 } catch (Exception e) { 69 } 70 catch (Exception e) { 69 71 throw new PersistenceException("Exception caught during KeyValuePair decomposition", e); 70 72 } … … 85 87 t.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) 86 88 .Single(fi => fi.Name == "value").SetValue(instance, iter.Current.Value); 87 } catch (InvalidOperationException e) { 89 } 90 catch (InvalidOperationException e) { 88 91 throw new PersistenceException("Not enough components to populate KeyValuePair instance", e); 89 } catch (Exception e) { 92 } 93 catch (Exception e) { 90 94 throw new PersistenceException("Exception caught during KeyValuePair reconstruction", e); 91 95 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Number2StringSerializer.cs
r3811 r4068 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using System.Linq; 25 using HeuristicLab.Persistence.Auxiliary; 26 using HeuristicLab.Persistence.Core; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Persistence.Default.Xml; 29 using HeuristicLab.Persistence.Default.Xml.Primitive; 24 30 using HeuristicLab.Persistence.Interfaces; 25 using HeuristicLab.Persistence.Core;26 using HeuristicLab.Persistence.Auxiliary;27 using System.Collections.Generic;28 using System.Reflection;29 using System.Globalization;30 using System.Text;31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;32 using HeuristicLab.Persistence.Default.Xml.Primitive;33 using HeuristicLab.Persistence.Default.Xml;34 31 35 32 namespace HeuristicLab.Persistence.Default.CompositeSerializers { … … 63 60 64 61 static Number2StringSerializer() { 65 numberSerializerMap = new Dictionary<Type, IPrimitiveSerializer>();62 numberSerializerMap = new Dictionary<Type, IPrimitiveSerializer>(); 66 63 foreach (var s in numberSerializers) { 67 64 numberSerializerMap[s.SourceType] = s; … … 111 108 try { 112 109 return numberSerializerMap[type].Parse(new XmlString(stringValue)); 113 } catch (FormatException e) { 110 } 111 catch (FormatException e) { 114 112 throw new PersistenceException("Invalid element data during number parsing.", e); 115 } catch (OverflowException e) { 113 } 114 catch (OverflowException e) { 116 115 throw new PersistenceException("Overflow during number parsing.", e); 117 116 } … … 166 165 it.MoveNext(); 167 166 return Parse((string)it.Current.Value, type); 168 } catch (InvalidOperationException e) { 167 } 168 catch (InvalidOperationException e) { 169 169 throw new PersistenceException( 170 170 String.Format("Insufficient meta information to reconstruct number of type {0}.", 171 171 type.VersionInvariantName()), e); 172 } catch (InvalidCastException e) { 172 } 173 catch (InvalidCastException e) { 173 174 throw new PersistenceException("Invalid meta information element type", e); 174 175 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/NumberEnumerable2StringSerializer.cs
r3937 r4068 21 21 22 22 using System; 23 using HeuristicLab.Persistence.Interfaces;24 using HeuristicLab.Persistence.Core;25 23 using System.Collections.Generic; 26 24 using System.Reflection; 27 using System.Globalization;28 25 using System.Text; 26 using HeuristicLab.Persistence.Auxiliary; 27 using HeuristicLab.Persistence.Core; 29 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Persistence. Auxiliary;29 using HeuristicLab.Persistence.Interfaces; 31 30 32 31 namespace HeuristicLab.Persistence.Default.CompositeSerializers { … … 130 129 addMethod.Invoke(instance, new[] { numberConverter.Parse(value, elementType) }); 131 130 } 132 } catch (InvalidOperationException e) { 131 } 132 catch (InvalidOperationException e) { 133 133 throw new PersistenceException("Insufficient element data to reconstruct number enumerable", e); 134 } catch (InvalidCastException e) { 134 } 135 catch (InvalidCastException e) { 135 136 throw new PersistenceException("Invalid element data during reconstruction of number enumerable", e); 136 137 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/StackSerializer.cs
r3742 r4068 22 22 using System; 23 23 using System.Collections; 24 using System.Collections.Generic; 24 25 using System.Reflection; 25 26 using HeuristicLab.Persistence.Core; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 28 using HeuristicLab.Persistence.Interfaces; 27 using System.Collections.Generic;28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;29 using System.IO;30 29 31 30 namespace HeuristicLab.Persistence.Default.CompositeSerializers { … … 46 45 47 46 public string JustifyRejection(Type type) { 48 47 return "not Stack or generic Stack<>"; 49 48 } 50 49 … … 73 72 foreach (var tag in tags) 74 73 addMethod.Invoke(instance, new[] { tag.Value }); 75 } catch (Exception e) { 74 } 75 catch (Exception e) { 76 76 throw new PersistenceException("Exception caught while trying to populate enumerable.", e); 77 77 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableAttribute.cs
r3742 r4068 21 21 22 22 using System; 23 using System.Linq;24 using System.Collections.Generic;25 using System.Reflection;26 23 using System.Text; 27 24 … … 38 35 AttributeTargets.Field | AttributeTargets.Property, 39 36 AllowMultiple = false, 40 Inherited = false)] 37 Inherited = false)] 41 38 public class StorableAttribute : Attribute { 42 39 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableClassAttribute.cs
r3742 r4068 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Reflection;25 using System.Linq;26 23 27 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable { 24 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable { 28 25 29 26 /// <summary> -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableClassType.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Reflection;25 using System.Linq;26 22 27 23 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable { … … 62 58 /// </summary> 63 59 AllFieldsAndAllProperties 64 }; 60 }; 65 61 } 66 62 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableConstructorAttribute.cs
r3742 r4068 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Linq;25 using System.Text;26 using System.Reflection;27 using HeuristicLab.Persistence.Core;28 23 29 24 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable { … … 39 34 /// </summary> 40 35 [AttributeUsage(AttributeTargets.Constructor, Inherited = false, AllowMultiple = false)] 41 public sealed class StorableConstructorAttribute : Attribute { 36 public sealed class StorableConstructorAttribute : Attribute { } 42 37 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableHookAttribute.cs
r3742 r4068 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Linq;25 using System.Text;26 using System.Reflection;27 23 28 24 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable { … … 39 35 /// </summary> 40 36 BeforeSerialization, 41 37 42 38 /// <summary> 43 39 /// States that this hook should be called after the storable 44 40 /// serializer hast complete re-assembled the object. 45 41 /// </summary> 46 AfterDeserialization }; 42 AfterDeserialization 43 }; 47 44 48 45 … … 52 49 /// </summary> 53 50 [AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = true)] 54 public sealed class StorableHookAttribute : Attribute { 51 public sealed class StorableHookAttribute : Attribute { 55 52 56 53 private readonly HookType hookType; … … 70 67 public StorableHookAttribute(HookType hookType) { 71 68 this.hookType = hookType; 72 } 69 } 73 70 } 74 71 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableMemberInfo.cs
r3742 r4068 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Linq;25 using HeuristicLab.Persistence.Interfaces;26 using HeuristicLab.Persistence.Core;27 23 using System.Reflection; 28 using HeuristicLab.Persistence.Auxiliary;29 24 using System.Text; 30 25 … … 59 54 return ((PropertyInfo)MemberInfo).GetGetMethod(true).GetBaseDefinition().DeclaringType; 60 55 } 61 } 56 } 62 57 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableReflection.cs
r3917 r4068 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Persistence.Interfaces;25 using System.Reflection; 26 26 using HeuristicLab.Persistence.Core; 27 using System.Reflection;28 using HeuristicLab.Persistence.Auxiliary;29 using System.Text;30 using System.Reflection.Emit;31 27 32 28 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableSerializer.cs
r3913 r4068 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Reflection; 26 using System.Reflection.Emit; 27 using System.Text; 28 using HeuristicLab.Persistence.Core; 25 29 using HeuristicLab.Persistence.Interfaces; 26 using HeuristicLab.Persistence.Core;27 using System.Reflection;28 using HeuristicLab.Persistence.Auxiliary;29 using System.Text;30 using System.Reflection.Emit;31 30 32 31 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable { … … 87 86 sb.Append("class has no default constructor and no [StorableConstructor]"); 88 87 if (!StorableReflection.IsEmptyOrStorableType(type, true)) 89 sb.Append("class (or one of its bases) is not empty and not marked [Storable]; "); 88 sb.Append("class (or one of its bases) is not empty and not marked [Storable]; "); 90 89 return sb.ToString(); 91 90 } … … 123 122 try { 124 123 return GetConstructor(type)(); 125 } catch (TargetInvocationException x) { 124 } 125 catch (TargetInvocationException x) { 126 126 throw new PersistenceException( 127 127 "Could not instantiate storable object: Encountered exception during constructor call", … … 188 188 189 189 private Dictionary<HookDesignator, List<StorableReflection.Hook>> hookCache = 190 new Dictionary<HookDesignator, List<StorableReflection.Hook>>(); 190 new Dictionary<HookDesignator, List<StorableReflection.Hook>>(); 191 191 192 192 #endregion … … 203 203 accessorListCache[type] = storableMembers; 204 204 return storableMembers; 205 } 205 } 206 206 } 207 207 … … 224 224 return c; 225 225 } 226 } 226 } 227 227 228 228 private Constructor GetDefaultConstructor(Type type) { 229 229 ConstructorInfo ci = type.GetConstructor(ALL_CONSTRUCTORS, null, Type.EmptyTypes, null); 230 230 if (ci == null) 231 return null; 231 return null; 232 232 DynamicMethod dm = new DynamicMethod("", typeof(object), null, type); 233 233 ILGenerator ilgen = dm.GetILGenerator(); … … 242 242 if (ci.GetParameters().Length != 1 || 243 243 ci.GetParameters()[0].ParameterType != typeof(bool)) 244 throw new PersistenceException("StorableConstructor must have exactly one argument of type bool"); 244 throw new PersistenceException("StorableConstructor must have exactly one argument of type bool"); 245 245 DynamicMethod dm = new DynamicMethod("", typeof(object), null, type); 246 246 ILGenerator ilgen = dm.GetILGenerator(); … … 252 252 } 253 253 return null; 254 } 254 } 255 255 256 256 private void InvokeHook(HookType hookType, object obj) { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/StructSerializer.cs
r3742 r4068 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Linq;25 using System.Text;26 using HeuristicLab.Persistence.Interfaces;27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;28 24 using System.Reflection; 29 25 using HeuristicLab.Persistence.Core; 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Persistence.Interfaces; 30 28 31 29 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 32 30 33 31 [StorableClass] 34 internal sealed class StructSerializer : ICompositeSerializer { 32 internal sealed class StructSerializer : ICompositeSerializer { 35 33 36 34 public int Priority { … … 39 37 40 38 public bool CanSerialize(Type type) { 41 return type.IsValueType && !type.IsPrimitive && !type.IsEnum && type.IsSealed; 39 return type.IsValueType && !type.IsPrimitive && !type.IsEnum && type.IsSealed; 42 40 } 43 41 … … 63 61 foreach (MemberInfo mi in t.GetMembers(AllInstanceMembers)) { 64 62 if (mi.MemberType == MemberTypes.Field) { 65 string name = mi.Name.Replace("<", "<").Replace(">", ">"); 63 string name = mi.Name.Replace("<", "<").Replace(">", ">"); 66 64 yield return new Tag(name, ((FieldInfo)mi).GetValue(obj)); 67 65 } … … 81 79 MemberInfo mi = mis[0]; 82 80 if (mi.MemberType == MemberTypes.Field) 83 ((FieldInfo)mi).SetValue(instance, t.Value); 81 ((FieldInfo)mi).SetValue(instance, t.Value); 84 82 else 85 83 throw new PersistenceException("invalid struct member type " + mi.MemberType.ToString()); 86 84 } 87 85 } 88 86 89 87 } 90 88 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/TypeSerializer.cs
r3742 r4068 21 21 22 22 using System; 23 using System.Collections.Generic; 24 using HeuristicLab.Persistence.Auxiliary; 23 25 using HeuristicLab.Persistence.Core; 24 using HeuristicLab.Persistence. Auxiliary;26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 27 using HeuristicLab.Persistence.Interfaces; 26 using System.Collections.Generic;27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;28 28 29 29 namespace HeuristicLab.Persistence.Default.CompositeSerializers { … … 57 57 try { 58 58 it.MoveNext(); 59 } catch (InvalidOperationException e) { 59 } 60 catch (InvalidOperationException e) { 60 61 throw new PersistenceException("Insufficient meta information to instantiate Type object", e); 61 62 } 62 63 try { 63 64 return TypeLoader.Load((string)it.Current.Value); 64 } catch (InvalidCastException e) { 65 } 66 catch (InvalidCastException e) { 65 67 throw new PersistenceException("Invalid meta information during reconstruction of Type object", e); 66 } catch (TypeLoadException e) { 68 } 69 catch (TypeLoadException e) { 67 70 throw new PersistenceException(String.Format( 68 71 "Cannot load Type {0}, make sure all required assemblies are available.", -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/DebugString.cs
r3742 r4068 20 20 #endregion 21 21 22 using System; 23 using System.Collections.Generic; 24 using System.Text; 22 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 23 using HeuristicLab.Persistence.Interfaces; 26 using HeuristicLab.Persistence.Default.Xml;27 using HeuristicLab.Persistence.Core;28 using HeuristicLab.Persistence.Core.Tokens;29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;30 24 31 25 namespace HeuristicLab.Persistence.Default.DebugString { … … 34 28 /// Simple write-only format for debugging purposes. 35 29 /// </summary> 36 [StorableClass] 30 [StorableClass] 37 31 public class DebugString : ISerialData { 38 32 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/DebugStringFormat.cs
r3742 r4068 20 20 #endregion 21 21 22 using System; 23 using System.Collections.Generic; 24 using System.Text; 22 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 23 using HeuristicLab.Persistence.Interfaces; 26 using HeuristicLab.Persistence.Default.Xml;27 using HeuristicLab.Persistence.Core;28 using HeuristicLab.Persistence.Core.Tokens;29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;30 24 31 25 namespace HeuristicLab.Persistence.Default.DebugString { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/DebugStringGenerator.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 22 using System.Text; 25 using HeuristicLab.Persistence.Interfaces;26 using HeuristicLab.Persistence.Default.Xml;27 23 using HeuristicLab.Persistence.Core; 28 24 using HeuristicLab.Persistence.Core.Tokens; 25 using HeuristicLab.Persistence.Interfaces; 29 26 30 27 namespace HeuristicLab.Persistence.Default.DebugString { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Bool2DebugStringSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Text;25 using HeuristicLab.Persistence.Interfaces;26 using HeuristicLab.Persistence.Default.Xml;27 using HeuristicLab.Persistence.Core;28 using HeuristicLab.Persistence.Core.Tokens;29 22 30 23 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Byte2DebugStringSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Text;25 using HeuristicLab.Persistence.Interfaces;26 using HeuristicLab.Persistence.Default.Xml;27 using HeuristicLab.Persistence.Core;28 using HeuristicLab.Persistence.Core.Tokens;29 22 30 23 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Char2DebugStringSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Text;25 using HeuristicLab.Persistence.Interfaces;26 using HeuristicLab.Persistence.Default.Xml;27 using HeuristicLab.Persistence.Core;28 using HeuristicLab.Persistence.Core.Tokens;29 22 30 23 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/DateTime2DebugStringSerializer.cs
r3742 r4068 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Text;25 using HeuristicLab.Persistence.Interfaces;26 using HeuristicLab.Persistence.Default.Xml;27 using HeuristicLab.Persistence.Core;28 using HeuristicLab.Persistence.Core.Tokens;29 23 30 24 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Double2DebugStringSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Text;25 using HeuristicLab.Persistence.Interfaces;26 using HeuristicLab.Persistence.Default.Xml;27 using HeuristicLab.Persistence.Core;28 using HeuristicLab.Persistence.Core.Tokens;29 22 30 23 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Float2DebugStringSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Text;25 using HeuristicLab.Persistence.Interfaces;26 using HeuristicLab.Persistence.Default.Xml;27 using HeuristicLab.Persistence.Core;28 using HeuristicLab.Persistence.Core.Tokens;29 22 30 23 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Int2DebugStringSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Text;25 using HeuristicLab.Persistence.Interfaces;26 using HeuristicLab.Persistence.Default.Xml;27 using HeuristicLab.Persistence.Core;28 using HeuristicLab.Persistence.Core.Tokens;29 22 30 23 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Long2DebugStringSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Text;25 using HeuristicLab.Persistence.Interfaces;26 using HeuristicLab.Persistence.Default.Xml;27 using HeuristicLab.Persistence.Core;28 using HeuristicLab.Persistence.Core.Tokens;29 22 30 23 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/SByte2DebugStringSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Text;25 using HeuristicLab.Persistence.Interfaces;26 using HeuristicLab.Persistence.Default.Xml;27 using HeuristicLab.Persistence.Core;28 using HeuristicLab.Persistence.Core.Tokens;29 22 30 23 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Short2DebugStringSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Text;25 using HeuristicLab.Persistence.Interfaces;26 using HeuristicLab.Persistence.Default.Xml;27 using HeuristicLab.Persistence.Core;28 using HeuristicLab.Persistence.Core.Tokens;29 22 30 23 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/String2DebugStringSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Text;25 using HeuristicLab.Persistence.Interfaces;26 using HeuristicLab.Persistence.Default.Xml;27 using HeuristicLab.Persistence.Core;28 using HeuristicLab.Persistence.Core.Tokens;29 22 30 23 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Type2DebugStringSerializer.cs
r3742 r4068 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Text;25 using HeuristicLab.Persistence.Interfaces;26 using HeuristicLab.Persistence.Default.Xml;27 using HeuristicLab.Persistence.Core;28 using HeuristicLab.Persistence.Core.Tokens;29 23 30 24 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/UInt2DebugStringSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Text;25 using HeuristicLab.Persistence.Interfaces;26 using HeuristicLab.Persistence.Default.Xml;27 using HeuristicLab.Persistence.Core;28 using HeuristicLab.Persistence.Core.Tokens;29 22 30 23 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/ULong2DebugStringSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Text;25 using HeuristicLab.Persistence.Interfaces;26 using HeuristicLab.Persistence.Default.Xml;27 using HeuristicLab.Persistence.Core;28 using HeuristicLab.Persistence.Core.Tokens;29 22 30 23 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/UShort2DebugStringSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Text;25 using HeuristicLab.Persistence.Interfaces;26 using HeuristicLab.Persistence.Default.Xml;27 using HeuristicLab.Persistence.Core;28 using HeuristicLab.Persistence.Core.Tokens;29 22 30 23 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/ValueType2DebugStringSerializerBase.cs
r3742 r4068 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Text;25 23 using HeuristicLab.Persistence.Interfaces; 26 using HeuristicLab.Persistence.Default.Xml;27 using HeuristicLab.Persistence.Core;28 using HeuristicLab.Persistence.Core.Tokens;29 24 30 25 namespace HeuristicLab.Persistence.Default.DebugString.PrimitiveSerializers { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/ByteArray2XmlSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Linq;25 using System.Text;26 22 27 23 namespace HeuristicLab.Persistence.Default.Xml.Compact { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/CompactXmlSerializerBase.cs
r3742 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Persistence.Interfaces;23 using HeuristicLab.Persistence.Core;24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;25 22 26 23 namespace HeuristicLab.Persistence.Default.Xml.Compact { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/DoubleArray2XmlSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using HeuristicLab.Persistence.Core;24 22 using HeuristicLab.Persistence.Default.Xml.Primitive; 25 23 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/DoubleList2XmlSerializer.cs
r3937 r4068 20 20 #endregion 21 21 22 using System .Collections;22 using System; 23 23 using System.Collections.Generic; 24 using System ;25 using System.Linq;24 using System.Text; 25 using HeuristicLab.Persistence.Auxiliary; 26 26 using HeuristicLab.Persistence.Core; 27 27 using HeuristicLab.Persistence.Default.Xml.Primitive; 28 using System.Text;29 using HeuristicLab.Persistence.Auxiliary;30 28 31 29 namespace HeuristicLab.Persistence.Default.Xml.Compact { … … 48 46 } 49 47 return list; 50 } catch (InvalidCastException e) { 48 } 49 catch (InvalidCastException e) { 51 50 throw new PersistenceException("Invalid element data during reconstruction of List<double>.", e); 52 } catch (OverflowException e) { 51 } 52 catch (OverflowException e) { 53 53 throw new PersistenceException("Overflow during element parsing while trying to reconstruct List<double>.", e); 54 54 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/IntArray2XmlSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using HeuristicLab.Persistence.Core;24 22 25 23 namespace HeuristicLab.Persistence.Default.Xml.Compact { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/IntList2XmlSerializer.cs
r3742 r4068 22 22 using System.Collections; 23 23 using System.Collections.Generic; 24 using System;25 using HeuristicLab.Persistence.Core;26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;27 24 28 25 namespace HeuristicLab.Persistence.Default.Xml.Compact { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/NumberArray2XmlSerializerBase.cs
r3945 r4068 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections; 24 using System.Collections.Generic; 23 25 using System.Text; 24 using HeuristicLab.Persistence.Interfaces; 25 using System; 26 using HeuristicLab.Persistence.Auxiliary; 26 27 using HeuristicLab.Persistence.Core; 27 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Persistence.Auxiliary;29 using HeuristicLab.Tracing;30 using System.Collections.Generic;31 29 32 30 namespace HeuristicLab.Persistence.Default.Xml.Compact { … … 51 49 lengths[i] = a.GetLength(i); 52 50 nElements *= lengths[i]; 53 } 51 } 54 52 sb.EnsureCapacity(sb.Length + nElements * 3); 55 53 for (int i = 0; i < a.Rank; i++) { … … 71 69 } 72 70 } 73 } 71 } 74 72 return new XmlString(sb.ToString()); 75 73 } … … 92 90 Array a = Array.CreateInstance(this.SourceType.GetElementType(), lengths, lowerBounds); 93 91 int[] positions = (int[])lowerBounds.Clone(); 94 while (values.MoveNext()) { 92 while (values.MoveNext()) { 95 93 a.SetValue(ParseValue(values.Current), positions); 96 94 positions[0] += 1; … … 107 105 throw new PersistenceException("Insufficient number of elements while trying to fill number array."); 108 106 return (T)(object)a; 109 } catch (InvalidOperationException e) { 107 } 108 catch (InvalidOperationException e) { 110 109 throw new PersistenceException("Insufficient information to rebuild number array.", e); 111 } catch (InvalidCastException e) { 110 } 111 catch (InvalidCastException e) { 112 112 throw new PersistenceException("Invalid element data or meta data to reconstruct number array.", e); 113 } catch (OverflowException e) { 113 } 114 catch (OverflowException e) { 114 115 throw new PersistenceException("Overflow during element parsing while trying to reconstruct number array.", e); 115 116 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/NumberEnumeration2XmlSerializerBase.cs
r3937 r4068 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections; 23 24 using System.Text; 24 using HeuristicLab.Persistence.Interfaces; 25 using System; 25 using HeuristicLab.Persistence.Auxiliary; 26 26 using HeuristicLab.Persistence.Core; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Persistence.Auxiliary;29 28 30 29 namespace HeuristicLab.Persistence.Default.Xml.Compact { … … 55 54 } 56 55 return (T)enumeration; 57 } catch (InvalidCastException e) { 56 } 57 catch (InvalidCastException e) { 58 58 throw new PersistenceException("Invalid element data during reconstruction of number enumerable.", e); 59 } catch (OverflowException e) { 59 } 60 catch (OverflowException e) { 60 61 throw new PersistenceException("Overflow during element parsing while trying to reconstruct number enumerable.", e); 61 62 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/EasyXmlGenerator.cs
r3937 r4068 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 using System; 24 using System.Text; 24 using System.IO; 25 using HeuristicLab.Persistence.Auxiliary; 26 using HeuristicLab.Persistence.Core; 27 using HeuristicLab.Persistence.Core.Tokens; 25 28 using HeuristicLab.Persistence.Interfaces; 26 using HeuristicLab.Persistence.Core;27 using System.IO;28 using ICSharpCode.SharpZipLib.Zip;29 29 using HeuristicLab.Tracing; 30 using HeuristicLab.Persistence.Core.Tokens;31 using System.IO.Compression;32 using HeuristicLab.Persistence.Auxiliary;33 30 34 31 namespace HeuristicLab.Persistence.Default.Xml { … … 146 143 /// <param name="filename">The filename.</param> 147 144 /// <param name="config">The configuration.</param> 148 public static void Serialize(object obj, string filename, Configuration config) { 145 public static void Serialize(object obj, string filename, Configuration config) { 149 146 try { 150 147 string tempfile = Path.GetTempFileName(); … … 157 154 File.Copy(tempfile, filename, true); 158 155 File.Delete(tempfile); 159 } catch (Exception) { 156 } 157 catch (Exception) { 160 158 Logger.Warn("Exception caught, no data has been written."); 161 159 throw; … … 180 178 /// <param name="stream">The stream.</param> 181 179 /// <param name="config">The configuration.</param> 182 public static void Serialize(object obj, Stream stream, Configuration config) { 180 public static void Serialize(object obj, Stream stream, Configuration config) { 183 181 try { 184 182 using (StreamWriter writer = new StreamWriter(stream)) { … … 192 190 writer.Flush(); 193 191 } 194 } catch (PersistenceException) { 192 } 193 catch (PersistenceException) { 195 194 throw; 196 } catch (Exception e) { 195 } 196 catch (Exception e) { 197 197 throw new PersistenceException("Unexpected exception during Serialization.", e); 198 198 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Bool2XmlSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using HeuristicLab.Persistence.Core;24 using HeuristicLab.Persistence.Interfaces;25 using System.Reflection;26 using System.Globalization;27 22 28 23 namespace HeuristicLab.Persistence.Default.Xml.Primitive { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Byte2XmlSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using HeuristicLab.Persistence.Core;24 using HeuristicLab.Persistence.Interfaces;25 using System.Reflection;26 using System.Globalization;27 22 28 23 namespace HeuristicLab.Persistence.Default.Xml.Primitive { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Char2XmlFormatter.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 22 using HeuristicLab.Persistence.Core; 24 23 using HeuristicLab.Persistence.Interfaces; 25 using System.Reflection;26 using System.Globalization;27 24 28 25 namespace HeuristicLab.Persistence.Default.Xml.Primitive { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/DateTime2XmlSerializer.cs
r3742 r4068 22 22 using System; 23 23 using HeuristicLab.Persistence.Core; 24 using HeuristicLab.Persistence.Interfaces;25 24 26 25 namespace HeuristicLab.Persistence.Default.Xml.Primitive { … … 35 34 try { 36 35 return new DateTime(long.Parse(x.Data)); 37 } catch (Exception e) { 36 } 37 catch (Exception e) { 38 38 throw new PersistenceException("Exception caugth while trying to reconstruct DateTime object.", e); 39 39 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Decimal2XmlSerializer.cs
r3742 r4068 21 21 22 22 using System; 23 using HeuristicLab.Persistence.Core;24 using HeuristicLab.Persistence.Interfaces;25 using System.Reflection;26 23 using System.Globalization; 27 24 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Double2XmlSerializer.cs
r3742 r4068 21 21 22 22 using System; 23 using HeuristicLab.Persistence.Core;24 using HeuristicLab.Persistence.Interfaces;25 using System.Reflection;26 23 using System.Globalization; 27 24 … … 54 51 } 55 52 56 57 53 54 58 55 59 56 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Float2XmlSerializer.cs
r3742 r4068 21 21 22 22 using System; 23 using HeuristicLab.Persistence.Core;24 using HeuristicLab.Persistence.Interfaces;25 using System.Reflection;26 23 using System.Globalization; 27 24 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Guid2XmlSerializer.cs
r3742 r4068 21 21 22 22 using System; 23 using System.Globalization; 23 24 using HeuristicLab.Persistence.Core; 24 using HeuristicLab.Persistence.Interfaces;25 using System.Text;26 using System.Text.RegularExpressions;27 using System.Globalization;28 25 29 26 … … 39 36 try { 40 37 return new Guid(t.Data); 41 } catch (FormatException x) { 38 } 39 catch (FormatException x) { 42 40 throw new PersistenceException("Cannot parse Guid string representation.", x); 43 } catch (OverflowException x) { 41 } 42 catch (OverflowException x) { 44 43 throw new PersistenceException("Overflow during Guid parsing.", x); 45 44 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Int2XmlSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using HeuristicLab.Persistence.Core;24 using HeuristicLab.Persistence.Interfaces;25 using System.Reflection;26 using System.Globalization;27 22 28 23 namespace HeuristicLab.Persistence.Default.Xml.Primitive { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Long2XmlSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using HeuristicLab.Persistence.Core;24 using HeuristicLab.Persistence.Interfaces;25 using System.Reflection;26 using System.Globalization;27 22 28 23 namespace HeuristicLab.Persistence.Default.Xml.Primitive { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/PrimitiveXmlSerializerBase.cs
r3742 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Persistence.Interfaces;23 using HeuristicLab.Persistence.Core;24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;25 22 26 23 namespace HeuristicLab.Persistence.Default.Xml.Primitive { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/SByte2XmlSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using HeuristicLab.Persistence.Core;24 using HeuristicLab.Persistence.Interfaces;25 using System.Reflection;26 using System.Globalization;27 22 28 23 namespace HeuristicLab.Persistence.Default.Xml.Primitive { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Short2XmlSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using HeuristicLab.Persistence.Core;24 using HeuristicLab.Persistence.Interfaces;25 using System.Reflection;26 using System.Globalization;27 22 28 23 namespace HeuristicLab.Persistence.Default.Xml.Primitive { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/SimpleNumber2XmlSerializerBase.cs
r3742 r4068 21 21 22 22 using System; 23 using System.Reflection; 23 24 using HeuristicLab.Persistence.Core; 24 using HeuristicLab.Persistence.Interfaces;25 using System.Reflection;26 using System.Globalization;27 25 28 26 namespace HeuristicLab.Persistence.Default.Xml.Primitive { … … 46 44 try { 47 45 return (T)ParseMethod.Invoke(null, new[] { x.Data }); 48 } catch (Exception e) { 46 } 47 catch (Exception e) { 49 48 throw new PersistenceException("Could not parse simple number.", e); 50 49 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/String2XmlSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using HeuristicLab.Persistence.Core;24 using HeuristicLab.Persistence.Interfaces;25 22 using System.Text; 26 23 using System.Text.RegularExpressions; 27 using System.Globalization;24 using HeuristicLab.Persistence.Core; 28 25 29 26 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/System.Drawing/Bitmap2XmlSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Linq;25 using System.Text;26 22 using System.Drawing; 23 using System.Drawing.Imaging; 27 24 using System.IO; 28 using System.Drawing.Imaging;29 using System.Text.RegularExpressions;30 using HeuristicLab.Persistence.Core;31 25 using HeuristicLab.Persistence.Default.Xml.Compact; 32 26 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/TimeSpan2XmlSerializer.cs
r3742 r4068 22 22 using System; 23 23 using HeuristicLab.Persistence.Core; 24 using HeuristicLab.Persistence.Interfaces;25 using System.Text;26 using System.Text.RegularExpressions;27 using System.Globalization;28 24 29 25 … … 39 35 try { 40 36 return TimeSpan.Parse(t.Data); 41 } catch (FormatException x) { 37 } 38 catch (FormatException x) { 42 39 throw new PersistenceException("Cannot parse TimeSpan string representation.", x); 43 } catch (OverflowException x) { 40 } 41 catch (OverflowException x) { 44 42 throw new PersistenceException("Overflow during TimeSpan parsing.", x); 45 43 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/UInt2XmlSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using HeuristicLab.Persistence.Core;24 using HeuristicLab.Persistence.Interfaces;25 using System.Reflection;26 using System.Globalization;27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;28 22 29 23 namespace HeuristicLab.Persistence.Default.Xml.Primitive { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/ULong2XmlSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using HeuristicLab.Persistence.Core;24 using HeuristicLab.Persistence.Interfaces;25 using System.Reflection;26 using System.Globalization;27 22 28 23 namespace HeuristicLab.Persistence.Default.Xml.Primitive { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/UShort2XmlSerializer.cs
r3742 r4068 20 20 #endregion 21 21 22 using System;23 using HeuristicLab.Persistence.Core;24 using HeuristicLab.Persistence.Interfaces;25 using System.Reflection;26 using System.Globalization;27 22 28 23 namespace HeuristicLab.Persistence.Default.Xml.Primitive { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlFormat.cs
r3742 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 22 23 using HeuristicLab.Persistence.Interfaces; 23 using HeuristicLab.Persistence.Core;24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;25 24 26 25 namespace HeuristicLab.Persistence.Default.Xml { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlGenerator.cs
r3944 r4068 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 using System; 24 using System.IO; 25 using System.IO.Compression; 26 using System.Linq; 24 27 using System.Text; 25 using System.Linq; 28 using HeuristicLab.Persistence.Core; 29 using HeuristicLab.Persistence.Core.Tokens; 26 30 using HeuristicLab.Persistence.Interfaces; 27 using HeuristicLab.Persistence.Core; 28 using System.IO; 31 using HeuristicLab.Tracing; 29 32 using ICSharpCode.SharpZipLib.Zip; 30 using HeuristicLab.Tracing;31 using HeuristicLab.Persistence.Core.Tokens;32 using System.IO.Compression;33 33 34 34 namespace HeuristicLab.Persistence.Default.Xml { … … 257 257 {"typeName", lastTypeToken.TypeName }, 258 258 {"serializer", lastTypeToken.Serializer }}); 259 } finally { 259 } 260 finally { 260 261 lastTypeToken = null; 261 262 } … … 367 368 File.Copy(tempfile, filename, true); 368 369 File.Delete(tempfile); 369 } catch (Exception) { 370 } 371 catch (Exception) { 370 372 Logger.Warn("Exception caught, no data has been written."); 371 373 throw; … … 413 415 writer.Flush(); 414 416 } 415 } catch (PersistenceException) { 417 } 418 catch (PersistenceException) { 416 419 throw; 417 } catch (Exception e) { 420 } 421 catch (Exception e) { 418 422 throw new PersistenceException("Unexpected exception during Serialization.", e); 419 423 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlParser.cs
r3913 r4068 20 20 #endregion 21 21 22 using System.Xml;23 using System.Collections.Generic;24 22 using System; 25 23 using System.Collections; 24 using System.Collections.Generic; 26 25 using System.IO; 26 using System.IO.Compression; 27 using System.Xml; 27 28 using HeuristicLab.Persistence.Core; 29 using HeuristicLab.Persistence.Core.Tokens; 28 30 using HeuristicLab.Persistence.Interfaces; 29 31 using ICSharpCode.SharpZipLib.Zip; 30 using HeuristicLab.Persistence.Core.Tokens;31 using System.IO.Compression;32 32 33 33 namespace HeuristicLab.Persistence.Default.Xml { … … 75 75 try { 76 76 iterator = handlers[reader.Name].Invoke(); 77 } catch (KeyNotFoundException) { 77 } 78 catch (KeyNotFoundException) { 78 79 throw new PersistenceException(String.Format( 79 80 "Invalid XML tag \"{0}\" in persistence file.", … … 175 176 } 176 177 return typeCache; 177 } catch (PersistenceException) { 178 } 179 catch (PersistenceException) { 178 180 throw; 179 } catch (Exception e) { 181 } 182 catch (Exception e) { 180 183 throw new PersistenceException("Unexpected exception during type cache parsing.", e); 181 184 } … … 193 196 return Deserialize(file); 194 197 } 195 } finally { 198 } 199 finally { 196 200 TimeSpan end = System.Diagnostics.Process.GetCurrentProcess().TotalProcessorTime; 197 201 Tracing.Logger.Info(string.Format( … … 224 228 return deserializer.Deserialize(parser); 225 229 } 226 } catch (PersistenceException) { 230 } 231 catch (PersistenceException) { 227 232 throw; 228 } catch (Exception x) { 233 } 234 catch (Exception x) { 229 235 throw new PersistenceException("Unexpected exception during deserialization", x); 230 236 } … … 255 261 zipFile.Close(); 256 262 return result; 257 } catch (PersistenceException) { 263 } 264 catch (PersistenceException) { 258 265 throw; 259 } catch (Exception e) { 266 } 267 catch (Exception e) { 260 268 throw new PersistenceException("Unexpected exception during deserialization", e); 261 269 } -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlSerializerBase.cs
r3742 r4068 21 21 22 22 using HeuristicLab.Persistence.Interfaces; 23 using HeuristicLab.Persistence.Core;24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;25 23 26 24 namespace HeuristicLab.Persistence.Default.Xml { -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlString.cs
r3742 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Persistence.Interfaces;23 using HeuristicLab.Persistence.Core;24 22 using System.Text; 25 23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 using HeuristicLab.Persistence.Interfaces; 26 25 27 26 namespace HeuristicLab.Persistence.Default.Xml { … … 30 29 /// XML friendly encapsulation of string data. 31 30 /// </summary> 32 [StorableClass] 31 [StorableClass] 33 32 public class XmlString : ISerialData { 34 33 -
trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlStringConstants.cs
r3742 r4068 20 20 #endregion 21 21 22 using System.Collections.Generic;23 using System;24 using System.Text;25 using HeuristicLab.Persistence.Interfaces;26 using HeuristicLab.Persistence.Core;27 using System.IO;28 using ICSharpCode.SharpZipLib.Zip;29 using HeuristicLab.Tracing;30 using HeuristicLab.Persistence.Core.Tokens;31 22 32 23 namespace HeuristicLab.Persistence.Default.Xml { … … 41 32 public const string METAINFO = "METAINFO"; 42 33 } 43 34 44 35 }
Note: See TracChangeset
for help on using the changeset viewer.