Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1542


Ignore:
Timestamp:
04/08/09 17:05:17 (16 years ago)
Author:
epitzer
Message:

Numerous small changes, coding conventions, renames, mini refactoring (#548)

Location:
trunk/sources
Files:
13 added
4 deleted
33 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Persistence.GUI/3.3/PersistenceConfigurationForm.cs

    r1530 r1542  
    366366
    367367  [EmptyStorableClass]
    368   public class EmptyFormat : Format {
     368  public class EmptyFormat : FormatBase {
    369369    public override string Name { get { return "Empty"; } }
    370370    public static EmptyFormat Instance = new EmptyFormat();
  • trunk/sources/HeuristicLab.Persistence.Test/HeuristicLab.Persistence.Test.csproj

    r1534 r1542  
    99    <OutputType>Exe</OutputType>
    1010    <AppDesignerFolder>Properties</AppDesignerFolder>
    11     <RootNamespace>Test</RootNamespace>
    12     <AssemblyName>Test</AssemblyName>
     11    <RootNamespace>HeuristicLab.Persistence.Test</RootNamespace>
     12    <AssemblyName>HeuristicLab.Persistence.Test</AssemblyName>
    1313    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    1414    <FileAlignment>512</FileAlignment>
  • trunk/sources/HeuristicLab.Persistence.Test/NewSerializationTest.cs

    r1519 r1542  
    185185      r.myEnum = TestEnum.va1;
    186186      XmlGenerator.Serialize(r, "test.zip");     
    187       object o = XmlParser.DeSerialize("test.zip");
    188       Console.Out.WriteLine(Util.AutoFormat(o, true));
     187      object o = XmlParser.DeSerialize("test.zip");     
    189188      Console.WriteLine(ViewOnlyGenerator.Serialize(r));
    190189      Console.WriteLine(ViewOnlyGenerator.Serialize(o));
     
    199198      c.kvpList = new KeyValuePair<List<C>, C>(new List<C> { c }, c);
    200199      XmlGenerator.Serialize(cs, "test3.zip");
    201       object o = XmlParser.DeSerialize("test3.zip");
    202       Console.Out.WriteLine(Util.AutoFormat(o, true));
     200      object o = XmlParser.DeSerialize("test3.zip");     
    203201      Console.WriteLine(ViewOnlyGenerator.Serialize(cs));
    204202      Console.WriteLine(ViewOnlyGenerator.Serialize(o));
     
    220218      arrayListArray[2].Add(a);
    221219      XmlGenerator.Serialize(arrayListArray, "test4.zip");
    222       object o = XmlParser.DeSerialize("test4.zip");
    223       Console.Out.WriteLine(Util.AutoFormat(o, true));
     220      object o = XmlParser.DeSerialize("test4.zip");     
    224221      Console.WriteLine(ViewOnlyGenerator.Serialize(arrayListArray));
    225222      Console.WriteLine(ViewOnlyGenerator.Serialize(o));
     
    230227      XmlGenerator.Serialize(m, "test2.zip");
    231228      object o = XmlParser.DeSerialize("test2.zip");
    232       Console.Out.WriteLine(Util.AutoFormat(o, true));     
     229      Console.WriteLine(ViewOnlyGenerator.Serialize(m));
     230      Console.WriteLine(ViewOnlyGenerator.Serialize(o));     
    233231    }   
    234232
  • trunk/sources/HeuristicLab.Persistence/3.3/Core/Configuration.cs

    r1454 r1542  
    1313    private readonly Dictionary<Type, IDecomposer> decomposerCache;
    1414    [Storable]
    15     public readonly IFormat Format;
     15    public IFormat Format { get; set; }
    1616
    1717    private Configuration() {
  • trunk/sources/HeuristicLab.Persistence/3.3/Core/ConfigurationService.cs

    r1539 r1542  
    77using HeuristicLab.Persistence.Interfaces;
    88using HeuristicLab.Tracing;
     9using HeuristicLab.Persistence.Interfaces.Tokens;
    910
    1011namespace HeuristicLab.Persistence.Core {
     
    1415    private static ConfigurationService instance;
    1516    private readonly Dictionary<IFormat, Configuration> customConfigurations;
    16     public readonly Dictionary<IFormat, List<IFormatter>> Formatters;
    17     public readonly List<IDecomposer> Decomposers;
     17    public Dictionary<IFormat, List<IFormatter>> Formatters { get; private set; }
     18    public List<IDecomposer> Decomposers { get; private set; }
    1819   
    1920    public static ConfigurationService Instance {
     
    2526    }
    2627
    27     public ConfigurationService() {
     28    private ConfigurationService() {
    2829      Formatters = new Dictionary<IFormat, List<IFormatter>>();
    2930      Decomposers = new List<IDecomposer>();
     
    3536    public void LoadSettings() {
    3637      try {
    37         if (String.IsNullOrEmpty(Properties.Settings.Default.customConfigurations) ||
    38           String.IsNullOrEmpty(Properties.Settings.Default.customConfigurationsTypeCache))
     38        if (String.IsNullOrEmpty(Properties.Settings.Default.CustomConfigurations) ||
     39          String.IsNullOrEmpty(Properties.Settings.Default.CustomConfigurationsTypeCache))
    3940          return;
    40         DeSerializer deSerializer = new DeSerializer(
     41        Deserializer deSerializer = new Deserializer(
    4142          XmlParser.ParseTypeCache(
    4243          new StringReader(
    43             Properties.Settings.Default.customConfigurationsTypeCache)));
     44            Properties.Settings.Default.CustomConfigurationsTypeCache)));
    4445        XmlParser parser = new XmlParser(
    4546          new StringReader(
    46             Properties.Settings.Default.customConfigurations));
     47            Properties.Settings.Default.CustomConfigurations));
    4748        var newCustomConfigurations = (Dictionary<IFormat, Configuration>)
    48           deSerializer.DeSerialize(parser);
     49          deSerializer.Deserialize(parser);
    4950        foreach (var config in newCustomConfigurations) {
    5051          customConfigurations[config.Key] = config.Value;
     
    6869      foreach (string s in generator.Format(serializer.TypeCache))
    6970        configurationTypeCacheString.Append(s);
    70       Properties.Settings.Default.customConfigurations =
     71      Properties.Settings.Default.CustomConfigurations =
    7172        configurationString.ToString();
    72       Properties.Settings.Default.customConfigurationsTypeCache =
     73      Properties.Settings.Default.CustomConfigurationsTypeCache =
    7374        configurationTypeCacheString.ToString();
    7475      Properties.Settings.Default.Save();
  • trunk/sources/HeuristicLab.Persistence/3.3/Core/DataMemberAccessor.cs

    r1454 r1542  
    1616    public DataMemberAccessor(
    1717        MemberInfo memberInfo,
    18         StorableAttribute autoStorableAttribute,
     18        StorableAttribute storableAttribute,
    1919        object obj) {
    2020      if (memberInfo.MemberType == MemberTypes.Field) {
     
    3434                "The Storable attribute can only be applied to fields and properties.");
    3535      }
    36       Name = autoStorableAttribute.Name ?? memberInfo.Name;
    37       DefaultValue = autoStorableAttribute.DefaultValue;
     36      Name = storableAttribute.Name ?? memberInfo.Name;
     37      DefaultValue = storableAttribute.DefaultValue;
    3838    }
    3939
  • trunk/sources/HeuristicLab.Persistence/3.3/Core/DeSerializer.cs

    r1494 r1542  
    22using System;
    33using HeuristicLab.Persistence.Interfaces;
     4using HeuristicLab.Persistence.Interfaces.Tokens;
    45
    56namespace HeuristicLab.Persistence.Core { 
    67
    7   public struct ParentReference {} 
     8  public class ParentReference {} 
    89
    910  class CompositeObject {
     
    1819
    1920    public void AddValue(string name, object value, List<Thunk> finalFixes) {
    20       Tag t = new Tag(name, value) {finalFixes = finalFixes};
     21      Tag t = new Tag(name, value) {globalFinalFixes = finalFixes};
    2122      customValues.Add(t);
    2223    }
     
    3031  public delegate void Thunk();
    3132
    32   public class DeSerializer {
     33  public class Deserializer {
    3334   
    3435    private readonly Dictionary<int, object> id2obj;
     
    3839    private List<Thunk> finalFixes;
    3940
    40     public DeSerializer(
     41    public Deserializer(
    4142      IEnumerable<TypeMapping> typeCache) {     
    4243      id2obj = new Dictionary<int, object>();
    4344      parentStack = new Stack<CompositeObject>();
    4445      typeIds = new Dictionary<int, Type>();
    45       serializerMapping = createSerializers(typeCache);
     46      serializerMapping = CreateSerializers(typeCache);
    4647    }
    4748
    48     private Dictionary<Type, object> createSerializers(IEnumerable<TypeMapping> typeCache) {
     49    private Dictionary<Type, object> CreateSerializers(IEnumerable<TypeMapping> typeCache) {
    4950      var map = new Dictionary<Type, object>();
    5051      foreach (var typeMapping in typeCache) {
     
    5960    }
    6061
    61     public object DeSerialize(IEnumerable<ISerializationToken> tokens) {
     62    public object Deserialize(IEnumerable<ISerializationToken> tokens) {
    6263      finalFixes = new List<Thunk>();     
    6364      foreach (ISerializationToken token in tokens) {
  • trunk/sources/HeuristicLab.Persistence/3.3/Core/Serializer.cs

    r1454 r1542  
    33using System;
    44using HeuristicLab.Persistence.Interfaces;
     5using HeuristicLab.Persistence.Interfaces.Tokens;
    56
    67namespace HeuristicLab.Persistence.Core {
     
    4950
    5051    public IEnumerator<ISerializationToken> GetEnumerator() {
    51       DataMemberAccessor rootAccessor = new DataMemberAccessor(
    52         rootName, null, () => obj, null);
    53       IEnumerator<ISerializationToken> iterator = Serialize(rootAccessor);
    54       while (iterator.MoveNext())
    55         yield return iterator.Current;     
     52      return Serialize(new DataMemberAccessor(rootName, null, () => obj, null));
    5653    }
    5754   
     
    7572      IDecomposer decomposer = configuration.GetDecomposer(value.GetType());
    7673      if (decomposer != null)
    77         return CompositeEnumerator(accessor.Name, decomposer.DeCompose(value), id, typeId);                 
     74        return CompositeEnumerator(accessor.Name, decomposer.Decompose(value), id, typeId);                 
    7875      throw new ApplicationException(
    7976          String.Format(
     
    9289    private IEnumerator<ISerializationToken> PrimitiveEnumerator(string name,
    9390        int typeId, object serializedValue, int? id) {
    94       yield return new PrimitiveToken(name, typeId, serializedValue, id);
     91      yield return new PrimitiveToken(name, typeId, id, serializedValue);
    9592    }
    9693
  • trunk/sources/HeuristicLab.Persistence/3.3/Core/Tag.cs

    r1454 r1542  
    44
    55  public class Tag {
    6     public List<Thunk> finalFixes;
     6    internal List<Thunk> globalFinalFixes; // reference to final fixes of Deserializer
    77    public string Name { get; private set; }
    8     public object Value;      
     8    public object Value { get; set; }     
    99
    1010    public Tag(string name, object value) {
     
    1717    }
    1818    public void SafeSet(Setter setter) {
    19       if ( Value != null && Value.GetType() == typeof(ParentReference))
    20         finalFixes.Add(() => setter(Value));
     19      if ( Value as ParentReference != null)
     20        globalFinalFixes.Add(() => setter(Value));
    2121      else
    2222        setter(Value);
  • trunk/sources/HeuristicLab.Persistence/3.3/Core/TypeMapping.cs

    r1454 r1542  
    33namespace HeuristicLab.Persistence.Core {
    44
    5   public struct TypeMapping {
     5  public class TypeMapping {
    66    public readonly int Id;
    77    public readonly string TypeName;
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/ArrayDecomposer.cs

    r1539 r1542  
    1616    }
    1717
    18     public IEnumerable<Tag> DeCompose(object array) {
     18    public IEnumerable<Tag> Decompose(object array) {
    1919      Array a = (Array)array;     
    2020      yield return new Tag("rank", a.Rank);
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/DictionaryDecomposer.cs

    r1539 r1542  
    2323      key = v;
    2424      keyIsSet = true;
    25       check();
     25      Check();
    2626    }
    2727
     
    2929      value = v;
    3030      valueIsSet = true;
    31       check();
     31      Check();
    3232    }
    3333
    34     private void check() {
     34    private void Check() {
    3535      if ( keyIsSet && valueIsSet )
    3636        dict.Add(key, value);
     
    5050    }
    5151
    52     public IEnumerable<Tag> DeCompose(object o) {
     52    public IEnumerable<Tag> Decompose(object o) {
    5353      IDictionary dict = (IDictionary)o;     
    5454      foreach ( DictionaryEntry entry in dict) {
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/EnumDecomposer.cs

    r1539 r1542  
    1313
    1414    public bool CanDecompose(Type type) {
    15       return type.IsEnum || type == typeof (Enum);
     15      return type.IsEnum || type == typeof(Enum);
    1616    }
    1717
    18     public IEnumerable<Tag> DeCompose(object obj) {     
     18    public IEnumerable<Tag> Decompose(object obj) {     
    1919      yield return new Tag(Enum.GetName(obj.GetType(), obj));
    2020    }
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/EnumerableDecomposer.cs

    r1539 r1542  
    6868    }
    6969
    70     public IEnumerable<Tag> DeCompose(object obj) {
     70    public IEnumerable<Tag> Decompose(object obj) {
    7171      foreach (object o in (IEnumerable)obj) {
    7272        yield return new Tag(null, o);
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/KeyValuePairDecomposer.cs

    r1539 r1542  
    2121    }
    2222
    23     public IEnumerable<Tag> DeCompose(object o) {     
     23    public IEnumerable<Tag> Decompose(object o) {     
    2424      Type t = o.GetType();
    2525      yield return new Tag("key", t.GetProperty("Key").GetValue(o, null));
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/StorableDecomposer.cs

    r1539 r1542  
    1919    }   
    2020
    21     public IEnumerable<Tag> DeCompose(object obj) {
     21    public IEnumerable<Tag> Decompose(object obj) {
    2222      foreach (var mapping in StorableAttribute.GetAutostorableAccessors(obj)) {
    2323        yield return new Tag(mapping.Key, mapping.Value.Get());
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/TypeDecomposer.cs

    r1539 r1542  
    1717    }
    1818
    19     public IEnumerable<Tag> DeCompose(object obj) {
     19    public IEnumerable<Tag> Decompose(object obj) {
    2020      Type t = (Type) obj;
    2121      yield return new Tag("VersionInvariantName", t.VersionInvariantName());
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/X2StringDecomposer.cs

    r1539 r1542  
    99namespace HeuristicLab.Persistence.Default.Decomposers {
    1010
    11   public class Number2StringDecomposer : IDecomposer {
    12 
    13     public int Priority {
    14       get { return 100; }
    15     }
    16 
     11  public class Number2StringConverter {   
    1712
    1813    private static readonly List<Type> numberTypes =
     
    3429    private static readonly Dictionary<Type, MethodInfo> numberParsers; 
    3530
    36     static Number2StringDecomposer() {
     31    static Number2StringConverter() {
    3732      numberParsers = new Dictionary<Type, MethodInfo>();
    3833      foreach ( var type in numberTypes ) {
     
    5651      return obj.ToString();
    5752    }
    58 
    59     public IEnumerable<Tag> DeCompose(object obj) {     
    60       yield return new Tag(Format(obj));     
    61     }
    62 
    63     public object CreateInstance(Type type) {
    64       return null;
    65     }
    66 
     53   
    6754    public object Parse(string stringValue, Type type) {
    6855      return numberParsers[type]
     
    7259    }
    7360
    74     public object Populate(object instance, IEnumerable<Tag> tags, Type type) {     
    75       foreach (Tag tag in tags)
    76         return Parse((string)tag.Value, type);
    77       throw new ApplicationException("not enough tags to re-compose number.");
    78     }
    79 
    8061  } 
    8162
     
    9172    }
    9273
    93     public IEnumerable<Tag> DeCompose(object obj) {
     74    public IEnumerable<Tag> Decompose(object obj) {
    9475      yield return new Tag(((DateTime)obj).Ticks);
    9576    }
     
    11495    }
    11596   
    116     private static readonly Number2StringDecomposer numberDecomposer =
    117       new Number2StringDecomposer();   
     97    private static readonly Number2StringConverter numberConverter =
     98      new Number2StringConverter();   
    11899
    119100    public bool CanDecompose(Type type) {
    120101      return
    121102        (type.IsArray || type == typeof (Array)) &&
    122         numberDecomposer.CanDecompose(type.GetElementType());
    123     }
    124 
    125     public IEnumerable<Tag> DeCompose(object obj) {
     103        numberConverter.CanDecompose(type.GetElementType());
     104    }
     105
     106    public IEnumerable<Tag> Decompose(object obj) {
    126107      Array a = (Array) obj;
    127108      int[] lengths = new int[a.Rank];
     
    139120      int[] positions = (int[])lowerBounds.Clone();
    140121      while (positions[a.Rank - 1] < lengths[a.Rank - 1] + lowerBounds[a.Rank - 1]) {
    141         sb.Append(numberDecomposer.Format(a.GetValue(positions))).Append(';');
     122        sb.Append(numberConverter.Format(a.GetValue(positions))).Append(';');
    142123        positions[0] += 1;
    143124        for (int i = 0; i < a.Rank - 1; i++) {
     
    180161      while (valueIter.MoveNext()) {
    181162        a.SetValue(
    182           numberDecomposer.Parse((string)valueIter.Current, elementType),         
     163          numberConverter.Parse((string)valueIter.Current, elementType),         
    183164          positions);
    184165        positions[0] += 1;
     
    202183    }
    203184
    204     private static readonly Number2StringDecomposer numberDecomposer =
    205       new Number2StringDecomposer();
     185    private static readonly Number2StringConverter numberConverter =
     186      new Number2StringConverter();
    206187   
    207188    private static readonly Dictionary<Type, Type> interfaceCache = new Dictionary<Type, Type>();
     
    213194        if (iface.IsGenericType &&
    214195          iface.GetGenericTypeDefinition() == typeof(IEnumerable<>) &&
    215           numberDecomposer.CanDecompose(iface.GetGenericArguments()[0])) {
     196          numberConverter.CanDecompose(iface.GetGenericArguments()[0])) {
    216197          interfaceCache.Add(type, iface);
    217198          return iface;
     
    243224    }
    244225
    245     public IEnumerable<Tag> DeCompose(object obj) {
     226    public IEnumerable<Tag> Decompose(object obj) {
    246227      Type type = obj.GetType();
    247228      Type enumerable = GetGenericEnumerableInterface(type);     
     
    259240      while ( (bool)moveNextMethod.Invoke(genericEnumerator, empty) )
    260241        sb.Append(
    261           numberDecomposer.Format(
     242          numberConverter.Format(
    262243            currentProperty.GetValue(genericEnumerator, null))).Append(';');
    263244      yield return new Tag("compact enumerable", sb.ToString());
     
    277258        .Split(new[] {';'}, StringSplitOptions.RemoveEmptyEntries);
    278259      foreach (var value in stringValues) {
    279         addMethod.Invoke(instance, new[] {numberDecomposer.Parse(value, elementType)});
     260        addMethod.Invoke(instance, new[] {numberConverter.Parse(value, elementType)});
    280261      }     
    281262      return instance;     
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/ViewOnly/ViewOnlyFormat.cs

    r1476 r1542  
    55using HeuristicLab.Persistence.Default.Xml;
    66using HeuristicLab.Persistence.Core;
     7using HeuristicLab.Persistence.Interfaces.Tokens;
    78
    89namespace HeuristicLab.Persistence.Default.ViewOnly {
    910
    10   public class ViewOnlyFormat : Format {
     11  public class ViewOnlyFormat : FormatBase {
    1112    public override string Name { get { return "ViewOnly"; } }
    1213    public static ViewOnlyFormat Instance = new ViewOnlyFormat();
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/DoubleArray2XmlFormatters.cs

    r1454 r1542  
    66
    77  [EmptyStorableClass]
    8   public class DoubleArray2XmlFormatter : NumberArray2XmlFormatter {
     8  public class DoubleArray2XmlFormatter : NumberArray2XmlFormatterBase {
    99
    1010    public override Type Type {
     
    1414    }
    1515
    16     protected override string formatValue(object o) {
     16    protected override string FormatValue(object o) {
    1717      return ((double)o).ToString("r", CultureInfo.InvariantCulture);
    1818    }
    1919
    20     protected override object parseValue(string o) {
     20    protected override object ParseValue(string o) {
    2121      return double.Parse(o);
    2222    }
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/DoubleList2XmlFormatter.cs

    r1454 r1542  
    88
    99  [EmptyStorableClass]
    10   public class DoubleList2XmlFormatter : NumberEnumeration2XmlFormatter {
     10  public class DoubleList2XmlFormatter : NumberEnumeration2XmlFormatterBase {
    1111
    1212    public override Type Type {
     
    2424    }
    2525
    26     protected override string formatValue(object o) {
     26    protected override string FormatValue(object o) {
    2727      return ((double)o).ToString("r", CultureInfo.InvariantCulture);
    2828    }
    2929
    30     protected override object parseValue(string o) {
     30    protected override object ParseValue(string o) {
    3131      return double.Parse(o);
    3232    }
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/IntArray2XmlFormatters.cs

    r1454 r1542  
    55
    66  [EmptyStorableClass]
    7   public class IntArray2XmlFormatter : NumberArray2XmlFormatter {
     7  public class IntArray2XmlFormatter : NumberArray2XmlFormatterBase {
    88
    99    public override Type Type {
     
    1313    }
    1414
    15     protected override string formatValue(object o) {
     15    protected override string FormatValue(object o) {
    1616      return o.ToString();
    1717    }
    1818
    19     protected override object parseValue(string o) {
     19    protected override object ParseValue(string o) {
    2020      return int.Parse(o);
    2121    }
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Compact/IntList2XmlFormatter.cs

    r1454 r1542  
    77
    88  [EmptyStorableClass]
    9   public class IntList2XmlFormatter : NumberEnumeration2XmlFormatter {
     9  public class IntList2XmlFormatter : NumberEnumeration2XmlFormatterBase {
    1010
    1111    public override Type Type {
     
    2323    }
    2424
    25     protected override string formatValue(object o) {
     25    protected override string FormatValue(object o) {
    2626      return o.ToString();
    2727    }
    2828
    29     protected override object parseValue(string o) {
     29    protected override object ParseValue(string o) {
    3030      return int.Parse(o);
    3131    }
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/String2XmlFormatter.cs

    r1476 r1542  
    33using HeuristicLab.Persistence.Core;
    44using HeuristicLab.Persistence.Interfaces;
     5using System.Xml;
    56
    67namespace HeuristicLab.Persistence.Default.Xml.Primitive {
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlFormat.cs

    r1454 r1542  
    55
    66  [EmptyStorableClass]
    7   public class XmlFormat : Format {
     7  public class XmlFormat : FormatBase {
    88    public override string Name { get { return "XML"; } }
    99    public static readonly XmlFormat Instance = new XmlFormat();
     10    private XmlFormat() { }
    1011  }
    1112
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlGenerator.cs

    r1476 r1542  
    88using HeuristicLab.Tracing;
    99using log4net;
     10using HeuristicLab.Persistence.Interfaces.Tokens;
    1011
    1112namespace HeuristicLab.Persistence.Default.Xml {
     
    1617    public const string REFERENCE = "REFERENCE";
    1718    public const string NULL = "NULL";
    18     public const string TYPECACHE = "TYPCACHE";
     19    public const string TYPECACHE = "TYPECACHE";
    1920    public const string TYPE = "TYPE";
    2021  }
     
    136137    }
    137138
    138     public static void Serialize(object o, string basename) {     
    139       Serialize(o, basename, ConfigurationService.Instance.GetDefaultConfig(XmlFormat.Instance));
     139    public static void Serialize(object o, string filename) {     
     140      Serialize(o, filename, ConfigurationService.Instance.GetDefaultConfig(XmlFormat.Instance));
    140141    }
    141142
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlParser.cs

    r1466 r1542  
    77using HeuristicLab.Persistence.Interfaces;
    88using ICSharpCode.SharpZipLib.Zip;
     9using HeuristicLab.Persistence.Interfaces.Tokens;
    910
    1011namespace HeuristicLab.Persistence.Default.Xml {
     
    5960        reader.GetAttribute("name"),
    6061        int.Parse(reader.GetAttribute("typeId")),
    61         reader.ReadString(),
    62         id);
     62        id,
     63        reader.ReadString());       
    6364    }
    6465
     
    108109    public static object DeSerialize(string filename) {
    109110      ZipFile zipFile = new ZipFile(filename);     
    110       DeSerializer deSerializer = new DeSerializer(
     111      Deserializer deSerializer = new Deserializer(
    111112        ParseTypeCache(
    112113        new StreamReader(
     
    114115      XmlParser parser = new XmlParser(
    115116        new StreamReader(zipFile.GetInputStream(zipFile.GetEntry("data.xml"))));
    116       return deSerializer.DeSerialize(parser);     
     117      return deSerializer.Deserialize(parser);     
    117118    }
    118119  } 
  • trunk/sources/HeuristicLab.Persistence/3.3/HeuristicLab.Persistence-3.3.csproj

    r1538 r1542  
    108108    <Compile Include="Default\Xml\Compact\DoubleArray2XmlFormatters.cs" />
    109109    <Compile Include="Default\Xml\Compact\DoubleList2XmlFormatter.cs" />
    110     <Compile Include="Default\Xml\Compact\NumberEnumeration2XmlFormatter.cs" />
    111     <Compile Include="Default\Xml\Compact\NumberArray2XmlFormatters.cs" />
     110    <Compile Include="Default\Xml\Compact\NumberEnumeration2XmlFormatterBase.cs" />
     111    <Compile Include="Default\Xml\Compact\NumberArray2XmlFormatterBase.cs" />
    112112    <Compile Include="Core\DataMemberAccessor.cs" />
    113113    <Compile Include="Default\Xml\Compact\IntList2XmlFormatter.cs" />
     
    121121    <Compile Include="Core\DeSerializer.cs" />
    122122    <Compile Include="Core\Tag.cs" />
     123    <Compile Include="Interfaces\IFormat.cs" />
     124    <Compile Include="Interfaces\FormatBase.cs" />
    123125    <Compile Include="Interfaces\IDecomposer.cs" />
    124126    <Compile Include="Interfaces\IFormatter.cs" />
    125127    <Compile Include="Core\ConfigurationService.cs" />
     128    <Compile Include="Interfaces\Tokens\ISerializationToken.cs" />
     129    <Compile Include="Interfaces\Tokens\SerializationTokenBase.cs" />
     130    <Compile Include="Interfaces\Tokens\CompositeTokenBase.cs" />
     131    <Compile Include="Interfaces\Tokens\BeginToken.cs" />
     132    <Compile Include="Interfaces\Tokens\EndToken.cs" />
     133    <Compile Include="Interfaces\Tokens\PrimitiveToken.cs" />
     134    <Compile Include="Interfaces\Tokens\ReferenceToken.cs" />
     135    <Compile Include="Interfaces\Tokens\NulLReferenceToken.cs" />
    126136    <Compile Include="Properties\AssemblyInfo.cs" />
    127137    <Compile Include="Core\Serializer.cs" />
    128     <Compile Include="Interfaces\Tokens.cs" />
    129138    <Compile Include="Properties\Settings.Designer.cs">
    130139      <AutoGen>True</AutoGen>
     
    132141      <DependentUpon>Settings.settings</DependentUpon>
    133142    </Compile>
    134     <Compile Include="Util.cs" />
    135143    <Compile Include="Core\StorableAttribute.cs" />
    136144    <Compile Include="Default\Xml\XmlGenerator.cs" />
  • trunk/sources/HeuristicLab.Persistence/3.3/Interfaces/IDecomposer.cs

    r1539 r1542  
    2626    /// the same as they are supplied in the Compose method.
    2727    /// </summary>   
    28     IEnumerable<Tag> DeCompose(object obj);
     28    IEnumerable<Tag> Decompose(object obj);
    2929
    3030    /// <summary>
  • trunk/sources/HeuristicLab.Persistence/3.3/Interfaces/IFormatter.cs

    r1454 r1542  
    22
    33namespace HeuristicLab.Persistence.Interfaces {
    4 
    5   public interface IFormat {
    6     string Name { get; }
    7   }
    8 
    9   public abstract class Format : IFormat {
    10     public abstract string Name { get;  }
    11     public override bool Equals(object obj) {
    12       return Name == ((Format) obj).Name;
    13     }
    14     public override int GetHashCode() {
    15       return Name.GetHashCode();
    16     }
    17   }
    184
    195  public interface IFormatter {
  • trunk/sources/HeuristicLab.Persistence/3.3/Properties/Settings.Designer.cs

    r1454 r1542  
    22// <auto-generated>
    33//     This code was generated by a tool.
    4 //     Runtime Version:2.0.50727.3053
     4//     Runtime Version:2.0.50727.3074
    55//
    66//     Changes to this file may cause incorrect behavior and will be lost if
     
    2727        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    2828        [global::System.Configuration.DefaultSettingValueAttribute("")]
    29         public string customConfigurations {
     29        public string CustomConfigurations {
    3030            get {
    31                 return ((string)(this["customConfigurations"]));
     31                return ((string)(this["CustomConfigurations"]));
    3232            }
    3333            set {
    34                 this["customConfigurations"] = value;
     34                this["CustomConfigurations"] = value;
    3535            }
    3636        }
     
    3939        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    4040        [global::System.Configuration.DefaultSettingValueAttribute("")]
    41         public string customConfigurationsTypeCache {
     41        public string CustomConfigurationsTypeCache {
    4242            get {
    43                 return ((string)(this["customConfigurationsTypeCache"]));
     43                return ((string)(this["CustomConfigurationsTypeCache"]));
    4444            }
    4545            set {
    46                 this["customConfigurationsTypeCache"] = value;
     46                this["CustomConfigurationsTypeCache"] = value;
    4747            }
    4848        }
  • trunk/sources/HeuristicLab.Persistence/3.3/Properties/Settings.settings

    r1454 r1542  
    33  <Profiles />
    44  <Settings>
    5     <Setting Name="customConfigurations" Type="System.String" Scope="User">
     5    <Setting Name="CustomConfigurations" Type="System.String" Scope="User">
    66      <Value Profile="(Default)" />
    77    </Setting>
    8     <Setting Name="customConfigurationsTypeCache" Type="System.String" Scope="User">
     8    <Setting Name="CustomConfigurationsTypeCache" Type="System.String" Scope="User">
    99      <Value Profile="(Default)" />
    1010    </Setting>
  • trunk/sources/HeuristicLab.Persistence/3.3/app.config

    r1530 r1542  
    88    <userSettings>
    99        <HeuristicLab.Persistence.Properties.Settings>
    10             <setting name="customConfigurations" serializeAs="String">
     10            <setting name="CustomConfigurations" serializeAs="String">
    1111                <value />
    1212            </setting>
    13             <setting name="customConfigurationsTypeCache" serializeAs="String">
     13            <setting name="CustomConfigurationsTypeCache" serializeAs="String">
    1414                <value />
    1515            </setting>
Note: See TracChangeset for help on using the changeset viewer.