Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/16/17 11:32:56 (7 years ago)
Author:
gkronber
Message:

#2520: improved conversions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/TypeInfo.cs

    r15020 r15034  
    5959      if (StorableTypeAttribute != null) {
    6060        // check constructors (
    61         if (!type.IsValueType && !type.IsEnum && !type.IsInterface && 
     61        if (!type.IsValueType && !type.IsEnum && !type.IsInterface &&
    6262          GetStorableConstructor() == null && GetDefaultConstructor() == null)
    6363          throw new PersistenceException("No storable constructor or parameterless constructor found.");
    6464
    65           // traverse type hierarchy from base type to sub types
    66           Stack<Type> types = new Stack<Type>();
     65        // traverse type hierarchy from base type to sub types
     66        Stack<Type> types = new Stack<Type>();
    6767        while (type != null) {
    6868          types.Push(type);
     
    9595            foreach (var property in propertyInfos) {
    9696              var attrib = StorableAttribute.GetStorableAttribute(property);
    97               if (!attrib.AllowOneWay && (!property.CanRead || !property.CanWrite))
     97              if ((!property.CanRead || !property.CanWrite) && (attrib == null || !attrib.AllowOneWay))
    9898                throw new PersistenceException("Properties must be readable and writable or explicity enable one way serialization.");
    9999
Note: See TracChangeset for help on using the changeset viewer.