Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/04/17 17:19:35 (8 years ago)
Author:
gkronber
Message:

#2520: changed all usages of StorableClass to use StorableType with an auto-generated GUID (did not add StorableType to other type definitions yet)

Location:
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default
Files:
36 edited

Legend:

Unmodified
Added
Removed
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/ArraySerializer.cs

    r14185 r14927  
    2323using System.Collections.Generic;
    2424using HeuristicLab.Persistence.Core;
    25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     25using HeuristicLab.Persistence;
    2626using HeuristicLab.Persistence.Interfaces;
    2727
    2828namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    2929
    30   [StorableClass]
     30  [StorableType("17987df2-38f0-4158-b4c7-783ffa2737d1")]
    3131  internal sealed class ArraySerializer : ICompositeSerializer {
    3232
     
    9999        }
    100100        return Array.CreateInstance(t.GetElementType(), lengths, lowerBounds);
    101       }
    102       catch (InvalidOperationException x) {
     101      } catch (InvalidOperationException x) {
    103102        throw new PersistenceException("Insufficient meta information to construct array instance.", x);
    104       }
    105       catch (InvalidCastException x) {
     103      } catch (InvalidCastException x) {
    106104        throw new PersistenceException("Invalid format of array metainfo.", x);
    107105      }
     
    134132          }
    135133        }
    136       }
    137       catch (InvalidOperationException x) {
     134      } catch (InvalidOperationException x) {
    138135        throw new PersistenceException("Insufficient data to fill array instance", x);
    139       }
    140       catch (InvalidCastException x) {
     136      } catch (InvalidCastException x) {
    141137        throw new PersistenceException("Invalid element data. Cannot fill array", x);
    142       }
    143       catch (IndexOutOfRangeException x) {
     138      } catch (IndexOutOfRangeException x) {
    144139        throw new PersistenceException("Too many elements during array deserialization", x);
    145140      }
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/CompactNumberArray2StringSerializer.cs

    r14185 r14927  
    2626using HeuristicLab.Persistence.Auxiliary;
    2727using HeuristicLab.Persistence.Core;
    28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HeuristicLab.Persistence;
    2929using HeuristicLab.Persistence.Interfaces;
    3030
    3131namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3232
    33   [StorableClass]
     33  [StorableType("a5c269da-4122-4ea0-9eb7-c3441be404b8")]
    3434  public sealed class CompactNumberArray2StringSerializer : ICompositeSerializer {
    3535
     
    187187        }
    188188        return a;
    189       }
    190       catch (InvalidOperationException e) {
     189      } catch (InvalidOperationException e) {
    191190        throw new PersistenceException("Insuffictient data to deserialize compact array", e);
    192       }
    193       catch (InvalidCastException e) {
     191      } catch (InvalidCastException e) {
    194192        throw new PersistenceException("Invalid element data during compact array deserialization", e);
    195193      }
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/ConcreteDictionarySerializer.cs

    r14185 r14927  
    2525using System.Linq;
    2626using HeuristicLab.Persistence.Core;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Persistence;
    2828using HeuristicLab.Persistence.Interfaces;
    2929
    3030namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3131
    32   [StorableClass]
     32  [StorableType("0ce2011a-5666-40df-9874-f5eeccea5a72")]
    3333  internal sealed class ConcreteDictionarySerializer : ICompositeSerializer {
    3434
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/DictionarySerializer.cs

    r14185 r14927  
    2525using HeuristicLab.Persistence.Auxiliary;
    2626using HeuristicLab.Persistence.Core;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Persistence;
    2828using HeuristicLab.Persistence.Interfaces;
    2929
    3030namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3131
    32   [StorableClass]
     32  [StorableType("813d9a0f-a611-478e-8149-e5d338c9a273")]
    3333  internal sealed class DictionarySerializer : ICompositeSerializer {
    3434
     
    7979          dict.Add(key.Value, value.Value);
    8080        }
    81       }
    82       catch (InvalidOperationException e) {
     81      } catch (InvalidOperationException e) {
    8382        throw new PersistenceException("Dictionaries must contain an even number of elements (key+value).", e);
    84       }
    85       catch (NotSupportedException e) {
     83      } catch (NotSupportedException e) {
    8684        throw new PersistenceException("The serialized dictionary type was read-only or had a fixed size and cannot be deserialized.", e);
    87       }
    88       catch (ArgumentNullException e) {
     85      } catch (ArgumentNullException e) {
    8986        throw new PersistenceException("Dictionary key was null.", e);
    90       }
    91       catch (ArgumentException e) {
     87      } catch (ArgumentException e) {
    9288        throw new PersistenceException("Duplicate dictionary key.", e);
    9389      }
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/EnumSerializer.cs

    r14185 r14927  
    2323using System.Collections.Generic;
    2424using HeuristicLab.Persistence.Core;
    25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     25using HeuristicLab.Persistence;
    2626using HeuristicLab.Persistence.Interfaces;
    2727
    2828namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    2929
    30   [StorableClass]
     30  [StorableType("7ff55c07-1c83-4d0f-924a-37c28d936d74")]
    3131  internal sealed class EnumSerializer : ICompositeSerializer {
    3232
     
    6060        it.MoveNext();
    6161        return Enum.Parse(t, (string)it.Current.Value);
    62       }
    63       catch (InvalidOperationException e) {
     62      } catch (InvalidOperationException e) {
    6463        throw new PersistenceException("not enough meta information to recstruct enum", e);
    65       }
    66       catch (InvalidCastException e) {
     64      } catch (InvalidCastException e) {
    6765        throw new PersistenceException("invalid meta information found while trying to reconstruct enum", e);
    6866      }
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/EnumerableSerializer.cs

    r14185 r14927  
    2626using HeuristicLab.Persistence.Auxiliary;
    2727using HeuristicLab.Persistence.Core;
    28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HeuristicLab.Persistence;
    2929using HeuristicLab.Persistence.Interfaces;
    3030
    3131namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3232
    33   [StorableClass]
     33  [StorableType("4421c2a4-9ee1-4cfc-b98e-755a81dc5241")]
    3434  internal sealed class EnumerableSerializer : ICompositeSerializer {
    3535
     
    8080        foreach (var tag in tags)
    8181          addMethod.Invoke(instance, new[] { tag.Value });
    82       }
    83       catch (Exception e) {
     82      } catch (Exception e) {
    8483        throw new PersistenceException("Exception caught while trying to populate enumerable.", e);
    8584      }
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/HashSetSerializer.cs

    r14185 r14927  
    2626using System.Reflection;
    2727using HeuristicLab.Persistence.Core;
    28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HeuristicLab.Persistence;
    2929using HeuristicLab.Persistence.Interfaces;
    3030
    3131namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3232
    33   [StorableClass]
     33  [StorableType("51099049-20f2-4a71-8eae-b4ea9d677115")]
    3434  internal sealed class HashSetSerializer : ICompositeSerializer {
    3535
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/KeyValuePairSerializer.cs

    r14185 r14927  
    2525using System.Reflection;
    2626using HeuristicLab.Persistence.Core;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Persistence;
    2828using HeuristicLab.Persistence.Interfaces;
    2929
    3030namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3131
    32   [StorableClass]
     32  [StorableType("97d00efc-4eb0-4dc7-a58c-977c45c2904c")]
    3333  internal sealed class KeyValuePairSerializer : ICompositeSerializer {
    3434
     
    6464      try {
    6565        key = new Tag("key", t.GetProperty("Key").GetValue(o, null));
    66       }
    67       catch (Exception e) {
     66      } catch (Exception e) {
    6867        throw new PersistenceException("Exception caught during KeyValuePair decomposition", e);
    6968      }
     
    7170      try {
    7271        value = new Tag("value", t.GetProperty("Value").GetValue(o, null));
    73       }
    74       catch (Exception e) {
     72      } catch (Exception e) {
    7573        throw new PersistenceException("Exception caught during KeyValuePair decomposition", e);
    7674      }
     
    9189        t.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)
    9290          .Single(fi => fi.Name == "value").SetValue(instance, iter.Current.Value);
    93       }
    94       catch (InvalidOperationException e) {
     91      } catch (InvalidOperationException e) {
    9592        throw new PersistenceException("Not enough components to populate KeyValuePair instance", e);
    96       }
    97       catch (Exception e) {
     93      } catch (Exception e) {
    9894        throw new PersistenceException("Exception caught during KeyValuePair reconstruction", e);
    9995      }
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Number2StringSerializer.cs

    r14185 r14927  
    2525using HeuristicLab.Persistence.Auxiliary;
    2626using HeuristicLab.Persistence.Core;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Persistence;
    2828using HeuristicLab.Persistence.Default.Xml;
    2929using HeuristicLab.Persistence.Default.Xml.Primitive;
     
    4040  /// but can be useful in generating custom serializers.
    4141  /// </summary>
    42   [StorableClass]
     42  [StorableType("23af67f5-2af6-4aca-b841-21345eacfb2f")]
    4343  public sealed class Number2StringSerializer : ICompositeSerializer {
    4444
     
    115115      try {
    116116        return numberSerializerMap[Nullable.GetUnderlyingType(type) ?? type].Parse(new XmlString(stringValue));
    117       }
    118       catch (FormatException e) {
     117      } catch (FormatException e) {
    119118        throw new PersistenceException("Invalid element data during number parsing.", e);
    120       }
    121       catch (OverflowException e) {
     119      } catch (OverflowException e) {
    122120        throw new PersistenceException("Overflow during number parsing.", e);
    123121      }
     
    172170        it.MoveNext();
    173171        return Parse((string)it.Current.Value, type);
    174       }
    175       catch (InvalidOperationException e) {
     172      } catch (InvalidOperationException e) {
    176173        throw new PersistenceException(
    177174          String.Format("Insufficient meta information to reconstruct number of type {0}.",
    178175          type.VersionInvariantName()), e);
    179       }
    180       catch (InvalidCastException e) {
     176      } catch (InvalidCastException e) {
    181177        throw new PersistenceException("Invalid meta information element type", e);
    182178      }
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/NumberEnumerable2StringSerializer.cs

    r14185 r14927  
    2626using HeuristicLab.Persistence.Auxiliary;
    2727using HeuristicLab.Persistence.Core;
    28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HeuristicLab.Persistence;
    2929using HeuristicLab.Persistence.Interfaces;
    3030
    3131namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3232
    33   [StorableClass]
     33  [StorableType("8bb7c8b8-89e5-41d4-a37e-c43e5beee451")]
    3434  internal sealed class NumberEnumerable2StringSerializer : ICompositeSerializer {
    3535
     
    136136          addMethod.Invoke(instance, new[] { numberConverter.Parse(value, elementType) });
    137137        }
    138       }
    139       catch (InvalidOperationException e) {
     138      } catch (InvalidOperationException e) {
    140139        throw new PersistenceException("Insufficient element data to reconstruct number enumerable", e);
    141       }
    142       catch (InvalidCastException e) {
     140      } catch (InvalidCastException e) {
    143141        throw new PersistenceException("Invalid element data during reconstruction of number enumerable", e);
    144142      }
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/QueueSerializer.cs

    r14185 r14927  
    2525using System.Reflection;
    2626using HeuristicLab.Persistence.Core;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Persistence;
    2828using HeuristicLab.Persistence.Interfaces;
    2929
    3030namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3131
    32   [StorableClass]
     32  [StorableType("7a0dee32-0800-4a78-a1c3-88cd97939ca0")]
    3333  internal sealed class QueueSerializer : ICompositeSerializer {
    3434
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/StackSerializer.cs

    r14185 r14927  
    2525using System.Reflection;
    2626using HeuristicLab.Persistence.Core;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Persistence;
    2828using HeuristicLab.Persistence.Interfaces;
    2929
    3030namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3131
    32   [StorableClass]
     32  [StorableType("e395b076-6001-417e-925c-8820cc0354df")]
    3333  internal sealed class StackSerializer : ICompositeSerializer {
    3434
     
    7676        foreach (var tag in tags)
    7777          addMethod.Invoke(instance, new[] { tag.Value });
    78       }
    79       catch (Exception e) {
     78      } catch (Exception e) {
    8079        throw new PersistenceException("Exception caught while trying to populate enumerable.", e);
    8180      }
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableSerializer.cs

    r14185 r14927  
    2828using HeuristicLab.Persistence.Core;
    2929using HeuristicLab.Persistence.Interfaces;
     30using HeuristicLab.Persistence;
    3031
    3132namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable {
     
    3839  /// or <c>AllFieldsAndAllProperties</c>.
    3940  /// </summary>
    40   [StorableClass]
     41  [StorableType("ea2bd700-d2c9-4319-9883-b795bd8f078f")]
    4142  public sealed class StorableSerializer : ICompositeSerializer {
    4243
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/StructSerializer.cs

    r14185 r14927  
    2424using System.Reflection;
    2525using HeuristicLab.Persistence.Core;
    26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     26using HeuristicLab.Persistence;
    2727using HeuristicLab.Persistence.Interfaces;
    2828
    2929namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3030
    31   [StorableClass]
     31  [StorableType("070243ae-13d3-490e-ad17-81a96941ea3c")]
    3232  internal sealed class StructSerializer : ICompositeSerializer {
    3333
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/TupleSerializer.cs

    r14185 r14927  
    2525using System.Reflection;
    2626using HeuristicLab.Persistence.Core;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Persistence;
    2828using HeuristicLab.Persistence.Interfaces;
    2929
    3030namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3131
    32   [StorableClass]
     32  [StorableType("604ea532-4a4f-4cf6-af44-1e56cf357997")]
    3333  internal sealed class TupleSerializer : ICompositeSerializer {
    3434
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/TypeSerializer.cs

    r14185 r14927  
    2424using HeuristicLab.Persistence.Auxiliary;
    2525using HeuristicLab.Persistence.Core;
    26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     26using HeuristicLab.Persistence;
    2727using HeuristicLab.Persistence.Interfaces;
    2828
    2929namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3030
    31   [StorableClass]
     31  [StorableType("dd23170e-0998-438a-b935-2061a7a4762e")]
    3232  internal sealed class TypeSerializer : ICompositeSerializer {
    3333
     
    6666      try {
    6767        it.MoveNext();
    68       }
    69       catch (InvalidOperationException e) {
     68      } catch (InvalidOperationException e) {
    7069        throw new PersistenceException("Insufficient meta information to instantiate Type object", e);
    7170      }
    7271      try {
    7372        return TypeLoader.Load((string)it.Current.Value);
    74       }
    75       catch (InvalidCastException e) {
     73      } catch (InvalidCastException e) {
    7674        throw new PersistenceException("Invalid meta information during reconstruction of Type object", e);
    77       }
    78       catch (TypeLoadException e) {
     75      } catch (TypeLoadException e) {
    7976        throw new PersistenceException(String.Format(
    8077          "Cannot load Type {0}, make sure all required assemblies are available.",
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/DebugString/DebugString.cs

    r14185 r14927  
    2020#endregion
    2121
    22 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     22using HeuristicLab.Persistence;
    2323using HeuristicLab.Persistence.Interfaces;
    2424
     
    2828  /// Simple write-only format for debugging purposes.
    2929  /// </summary>
    30   [StorableClass]
     30  [StorableType("05a1ee13-75c0-4ff1-b403-57573364d7e3")]
    3131  public class DebugString : ISerialData {
    3232
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/DebugString/DebugStringFormat.cs

    r14185 r14927  
    2020#endregion
    2121
    22 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     22using HeuristicLab.Persistence;
    2323using HeuristicLab.Persistence.Interfaces;
    2424
     
    2828  /// Simple write-only format for debugging purposes.
    2929  /// </summary>
    30   [StorableClass]
     30  [StorableType("90f9f859-5c96-4d91-8f17-826a401ecd8f")]
    3131  public class DebugStringFormat : FormatBase<DebugString> {
    3232    /// <summary>
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/DebugString/DebugStringGenerator.cs

    r14185 r14927  
    185185    /// <returns>A string representation of the complete object graph.</returns>
    186186    public static string Serialize(object o, Configuration configuration) {
    187       Serializer s = new Serializer(o, configuration);
     187      var s = new HeuristicLab.Persistence.Core.Serializer(o, configuration);
    188188      DebugStringGenerator generator = new DebugStringGenerator();
    189189      StringBuilder sb = new StringBuilder();
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/Xml/Compact/ByteArray2XmlSerializer.cs

    r14185 r14927  
    3636  internal sealed class Bytet2DArray2XmlSerializer : ByteArray2XmlSerializer<byte[,]> { }
    3737
    38   internal sealed class Byte3DArray2XmlSerializer : ByteArray2XmlSerializer<byte[, ,]> { }
     38  internal sealed class Byte3DArray2XmlSerializer : ByteArray2XmlSerializer<byte[,,]> { }
    3939}
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/Xml/Compact/DoubleArray2XmlSerializer.cs

    r14185 r14927  
    3939  internal sealed class Double2DArray2XmlSerializer : DoubleArray2XmlSerializerBase<double[,]> { }
    4040
    41   internal sealed class Double3DArray2XmlSerializer : DoubleArray2XmlSerializerBase<double[, ,]> { }
     41  internal sealed class Double3DArray2XmlSerializer : DoubleArray2XmlSerializerBase<double[,,]> { }
    4242
    4343}
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/Xml/Compact/DoubleList2XmlSerializer.cs

    r14185 r14927  
    4646        }
    4747        return list;
    48       }
    49       catch (InvalidCastException e) {
     48      } catch (InvalidCastException e) {
    5049        throw new PersistenceException("Invalid element data during reconstruction of List<double>.", e);
    51       }
    52       catch (OverflowException e) {
     50      } catch (OverflowException e) {
    5351        throw new PersistenceException("Overflow during element parsing while trying to reconstruct List<double>.", e);
    5452      }
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/Xml/Compact/IntArray2XmlSerializer.cs

    r14185 r14927  
    3838  internal class Int2DArray2XmlSerializer : IntArray2XmlSerializerBase<int[,]> { }
    3939
    40   internal class Int3DArray2XmlSerializer : IntArray2XmlSerializerBase<int[, ,]> { }
     40  internal class Int3DArray2XmlSerializer : IntArray2XmlSerializerBase<int[,,]> { }
    4141
    4242}
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/Xml/Compact/NumberArray2XmlSerializerBase.cs

    r14185 r14927  
    2727using HeuristicLab.Persistence.Auxiliary;
    2828using HeuristicLab.Persistence.Core;
    29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     29using HeuristicLab.Persistence;
    3030
    3131namespace HeuristicLab.Persistence.Default.Xml.Compact {
    3232
    33   [StorableClass]
     33  [StorableType("ed511bc6-4889-4be1-bb57-c819d3e9e7be")]
    3434  internal abstract class NumberArray2XmlSerializerBase<T> : CompactXmlSerializerBase<T> where T : class {
    3535
     
    108108          throw new PersistenceException("Insufficient number of elements while trying to fill number array.");
    109109        return (T)(object)a;
    110       }
    111       catch (InvalidOperationException e) {
     110      } catch (InvalidOperationException e) {
    112111        throw new PersistenceException("Insufficient information to rebuild number array.", e);
    113       }
    114       catch (InvalidCastException e) {
     112      } catch (InvalidCastException e) {
    115113        throw new PersistenceException("Invalid element data or meta data to reconstruct number array.", e);
    116       }
    117       catch (OverflowException e) {
     114      } catch (OverflowException e) {
    118115        throw new PersistenceException("Overflow during element parsing while trying to reconstruct number array.", e);
    119116      }
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/Xml/Compact/NumberEnumeration2XmlSerializerBase.cs

    r14185 r14927  
    2525using HeuristicLab.Persistence.Auxiliary;
    2626using HeuristicLab.Persistence.Core;
    27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Persistence;
    2828
    2929namespace HeuristicLab.Persistence.Default.Xml.Compact {
    3030
    31   [StorableClass]
     31  [StorableType("a0910e86-de41-4862-abf5-82bbed54de70")]
    3232  internal abstract class NumberEnumeration2XmlSerializerBase<T> : CompactXmlSerializerBase<T> where T : IEnumerable {
    3333
     
    5454        }
    5555        return (T)enumeration;
    56       }
    57       catch (InvalidCastException e) {
     56      } catch (InvalidCastException e) {
    5857        throw new PersistenceException("Invalid element data during reconstruction of number enumerable.", e);
    59       }
    60       catch (OverflowException e) {
     58      } catch (OverflowException e) {
    6159        throw new PersistenceException("Overflow during element parsing while trying to reconstruct number enumerable.", e);
    6260      }
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/Xml/EasyXmlGenerator.cs

    r14185 r14927  
    154154        File.Copy(tempfile, filename, true);
    155155        File.Delete(tempfile);
    156       }
    157       catch (Exception) {
     156      } catch (Exception) {
    158157        Logger.Warn("Exception caught, no data has been written.");
    159158        throw;
     
    181180      try {
    182181        using (StreamWriter writer = new StreamWriter(stream)) {
    183           Serializer serializer = new Serializer(obj, config);
     182          var serializer = new HeuristicLab.Persistence.Core.Serializer(obj, config);
    184183          serializer.InterleaveTypeInformation = true;
    185184          ReadableXmlGenerator generator = new ReadableXmlGenerator();
     
    190189          writer.Flush();
    191190        }
    192       }
    193       catch (PersistenceException) {
     191      } catch (PersistenceException) {
    194192        throw;
    195       }
    196       catch (Exception e) {
     193      } catch (Exception e) {
    197194        throw new PersistenceException("Unexpected exception during Serialization.", e);
    198195      }
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Char2XmlFormatter.cs

    r14185 r14927  
    3737
    3838    private static string ToBase64String(char c) {
    39       return string.Format("<Base64>{0}</Base64>", Convert.ToBase64String(Encoding.ASCII.GetBytes(new[] {c})));
     39      return string.Format("<Base64>{0}</Base64>", Convert.ToBase64String(Encoding.ASCII.GetBytes(new[] { c })));
    4040    }
    4141
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/DateTime2XmlSerializer.cs

    r14185 r14927  
    3434      try {
    3535        return new DateTime(long.Parse(x.Data));
    36       }
    37       catch (Exception e) {
     36      } catch (Exception e) {
    3837        throw new PersistenceException("Exception caugth while trying to reconstruct DateTime object.", e);
    3938      }
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Guid2XmlSerializer.cs

    r14185 r14927  
    3636      try {
    3737        return new Guid(t.Data);
    38       }
    39       catch (FormatException x) {
     38      } catch (FormatException x) {
    4039        throw new PersistenceException("Cannot parse Guid string representation.", x);
    41       }
    42       catch (OverflowException x) {
     40      } catch (OverflowException x) {
    4341        throw new PersistenceException("Overflow during Guid parsing.", x);
    4442      }
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/SimpleNumber2XmlSerializerBase.cs

    r14185 r14927  
    4444      try {
    4545        return (T)ParseMethod.Invoke(null, new[] { x.Data });
    46       }
    47       catch (Exception e) {
     46      } catch (Exception e) {
    4847        throw new PersistenceException("Could not parse simple number.", e);
    4948      }
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/System.Drawing/Bitmap2XmlSerializer.cs

    r14185 r14927  
    2828  internal sealed class Bitmap2XmlSerializer : PrimitiveXmlSerializerBase<Bitmap> {
    2929
    30     public override XmlString Format(Bitmap o) {     
     30    public override XmlString Format(Bitmap o) {
    3131      MemoryStream stream = new MemoryStream();
    3232      lock (o)
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/TimeSpan2XmlSerializer.cs

    r14185 r14927  
    3535      try {
    3636        return TimeSpan.Parse(t.Data);
    37       }
    38       catch (FormatException x) {
     37      } catch (FormatException x) {
    3938        throw new PersistenceException("Cannot parse TimeSpan string representation.", x);
    40       }
    41       catch (OverflowException x) {
     39      } catch (OverflowException x) {
    4240        throw new PersistenceException("Overflow during TimeSpan parsing.", x);
    4341      }
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/Xml/XmlFormat.cs

    r14185 r14927  
    2020#endregion
    2121
    22 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     22using HeuristicLab.Persistence;
    2323using HeuristicLab.Persistence.Interfaces;
    2424
     
    2929  /// or save to a file.
    3030  /// </summary>
    31   [StorableClass]
     31  [StorableType("8c79e9a6-02d6-471c-8787-43d96d61c1db")]
    3232  public class XmlFormat : FormatBase<XmlString> {
    3333    /// <summary>
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/Xml/XmlGenerator.cs

    r14185 r14927  
    6161    }
    6262
    63     protected enum NodeType { Start, End, Inline } ;
     63    protected enum NodeType { Start, End, Inline };
    6464
    6565    protected static void AddXmlTagContent(StringBuilder sb, string name, Dictionary<string, string> attributes) {
     
    256256          {"typeName", lastTypeToken.TypeName },
    257257          {"serializer", lastTypeToken.Serializer }});
    258       }
    259       finally {
     258      } finally {
    260259        lastTypeToken = null;
    261260      }
     
    313312    private static void Serialize(object obj, Stream stream, Configuration config, bool includeAssemblies
    314313   , CompressionLevel compression) {
    315       Serializer serializer = new Serializer(obj, config);
     314      var serializer = new HeuristicLab.Persistence.Core.Serializer(obj, config);
    316315      Serialize(stream, includeAssemblies, compression, serializer);
    317316    }
    318317
    319     private static void Serialize(Stream stream, bool includeAssemblies, CompressionLevel compression, Serializer serializer) {
     318    private static void Serialize(Stream stream, bool includeAssemblies, CompressionLevel compression, HeuristicLab.Persistence.Core.Serializer serializer) {
    320319      try {
    321320        DateTime start = DateTime.Now;
     
    360359        Logger.Info(String.Format("serialization took {0} seconds with compression level {1}",
    361360          (DateTime.Now - start).TotalSeconds, compression));
    362       }
    363       catch (Exception) {
     361      } catch (Exception) {
    364362        Logger.Warn("Exception caught, no data has been serialized.");
    365363        throw;
     
    385383        File.Copy(tempfile, filename, true);
    386384        File.Delete(tempfile);
    387       }
    388       catch (Exception) {
     385      } catch (Exception) {
    389386        Logger.Warn("Exception caught, no data has been written.");
    390387        throw;
     
    426423                                 CompressionType compressionType = CompressionType.GZip) {
    427424      try {
    428         Serializer serializer = new Serializer(obj, config);
     425        var serializer = new HeuristicLab.Persistence.Core.Serializer(obj, config);
    429426        if (compressionType == CompressionType.Zip) {
    430427          Serialize(obj, stream, config, includeAssemblies, CompressionLevel.Optimal);
     
    432429          Serialize(stream, serializer);
    433430        }
    434       }
    435       catch (PersistenceException) {
     431      } catch (PersistenceException) {
    436432        throw;
    437       }
    438       catch (Exception e) {
     433      } catch (Exception e) {
    439434        throw new PersistenceException("Unexpected exception during Serialization.", e);
    440435      }
     
    453448                                 CompressionType compressionType = CompressionType.GZip) {
    454449      try {
    455         Serializer serializer = new Serializer(obj, config);
     450        var serializer = new HeuristicLab.Persistence.Core.Serializer(obj, config);
    456451        if (compressionType == CompressionType.Zip) {
    457452          Serialize(stream, includeAssemblies, CompressionLevel.Optimal, serializer);
     
    460455        }
    461456        types = serializer.SerializedTypes;
    462       }
    463       catch (PersistenceException) {
     457      } catch (PersistenceException) {
    464458        throw;
    465       }
    466       catch (Exception e) {
     459      } catch (Exception e) {
    467460        throw new PersistenceException("Unexpected exception during Serialization.", e);
    468461      }
    469462    }
    470463
    471     private static void Serialize(Stream stream, Serializer serializer) {
     464    private static void Serialize(Stream stream, HeuristicLab.Persistence.Core.Serializer serializer) {
    472465      using (StreamWriter writer = new StreamWriter(new GZipStream(stream, CompressionMode.Compress))) {
    473466        serializer.InterleaveTypeInformation = true;
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/Xml/XmlParser.cs

    r14185 r14927  
    8181        try {
    8282          iterator = handlers[reader.Name].Invoke();
    83         }
    84         catch (KeyNotFoundException) {
     83        } catch (KeyNotFoundException) {
    8584          throw new PersistenceException(String.Format(
    8685            "Invalid XML tag \"{0}\" in persistence file.",
     
    182181        }
    183182        return typeCache;
    184       }
    185       catch (PersistenceException) {
     183      } catch (PersistenceException) {
    186184        throw;
    187       }
    188       catch (Exception e) {
     185      } catch (Exception e) {
    189186        throw new PersistenceException("Unexpected exception during type cache parsing.", e);
    190187      }
     
    204201          }
    205202        }
    206       }
    207       finally {
     203      } finally {
    208204        TimeSpan end = System.Diagnostics.Process.GetCurrentProcess().TotalProcessorTime;
    209205        Tracing.Logger.Info(string.Format(
     
    251247            return deserializer.Deserialize(parser);
    252248          }
    253         }
    254         catch (PersistenceException) {
     249        } catch (PersistenceException) {
    255250          throw;
    256         }
    257         catch (Exception x) {
     251        } catch (Exception x) {
    258252          throw new PersistenceException("Unexpected exception during deserialization", x);
    259253        }
     
    279273
    280274        return result;
    281       }
    282       catch (PersistenceException) {
     275      } catch (PersistenceException) {
    283276        throw;
    284       }
    285       catch (Exception e) {
     277      } catch (Exception e) {
    286278        throw new PersistenceException("Unexpected exception during deserialization", e);
    287279      }
  • branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/Xml/XmlString.cs

    r14185 r14927  
    2121
    2222using System.Text;
    23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     23using HeuristicLab.Persistence;
    2424using HeuristicLab.Persistence.Interfaces;
    2525
     
    2929  /// XML friendly encapsulation of string data.
    3030  /// </summary>
    31   [StorableClass]
     31  [StorableType("a358bb95-a494-4512-b1fe-53c66c77423c")]
    3232  public class XmlString : ISerialData {
    3333
Note: See TracChangeset for help on using the changeset viewer.