Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/03/17 18:41:01 (8 years ago)
Author:
gkronber
Message:

#2520 work in progress to support loading/saving of all samples

Location:
branches/PersistenceOverhaul/HeuristicLab.Persistence
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableSerializer.cs

    r14711 r14713  
    2121
    2222using System;
     23using System.CodeDom;
    2324using System.Collections.Generic;
    2425using System.Linq;
     
    6970    /// </returns>
    7071    public bool CanSerialize(Type type) {
    71       var markedStorable = StorableReflection.HasStorableClassAttribute(type);
     72      var markedStorable = StorableReflection.HasStorableClassAttribute(type) && !type.IsEnum && !type.IsValueType;
    7273      if (GetConstructor(type) == null)
    7374        if (markedStorable)
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/StaticCache.cs

    r14711 r14713  
    113113      // RegisterType(new Guid("3B3AA69E-1641-4202-AE1D-7EEFF60FA355"), typeof(double[]));
    114114      // RegisterType(new Guid("7DF325A6-2553-4915-B7C6-D98191107CB7"), typeof(string[]));
     115
     116      RegisterType(new Guid("E451A99B-0CFD-48E6-9BEF-0AE9D1E73628"), typeof(IList));                                       
    115117      RegisterType(new Guid("DB2A785C-5803-42C7-A01F-E1FD845A83A1"), typeof(List<>));
    116118      RegisterType(new Guid("EB98A564-BEDC-458A-9E9B-4BF3CDAFB9BE"), typeof(Stack<>));
     
    121123      RegisterType(new Guid("7E2F3277-7216-4295-A498-9ACA43527D5B"), typeof(HashSet<>));
    122124      RegisterType(new Guid("E92C35AD-32B1-4F37-B8D2-BE2F5FEB465B"), typeof(Dictionary<,>));
     125      RegisterType(new Guid("18504ADF-2332-4497-8CA0-B2F00CA2EBA2"), typeof(Type));
    123126
    124127      var allTypes = new Dictionary<string, Type>(5000);
     
    162165      RegisterType(new Guid("00C8C940-63D9-43FF-99BA-9C69301BF043"), allTypes["System.Collections.Generic.RandomizedObjectEqualityComparer"]);
    163166      RegisterType(new Guid("DAF22757-7FCC-49AC-B148-F3DD7E9E0A3B"), allTypes["System.Collections.Generic.IEqualityComparer`1"]);
    164 
    165167
    166168      //var registeredTypes = type2Guid.Keys.ToArray();
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Transformers/StorableClassTransformer.cs

    r14711 r14713  
    3030  internal sealed class StorableClassBoxTransformer : BoxTransformer<object> {
    3131    public override bool CanTransformType(Type type) {
    32       return StorableTypeAttribute.IsStorableType(type) && !type.IsValueType || // don't transform structs
     32      return StorableTypeAttribute.IsStorableType(type) && !type.IsValueType && !type.IsEnum || // don't transform structs or enums
    3333        type.BaseType != null && CanTransformType(type.BaseType);
    3434    }
Note: See TracChangeset for help on using the changeset viewer.