- Timestamp:
- 03/10/10 16:37:52 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableSerializer.cs
r2991 r2993 17 17 18 18 public bool CanSerialize(Type type) { 19 if (!ReflectionTools.HasDefaultConstructor(type)) 19 if (!ReflectionTools.HasDefaultConstructor(type) && 20 StorableConstructorAttribute.GetStorableConstructor(type) == null) 20 21 return false; 21 22 while (type != null) { … … 26 27 } 27 28 return true; 29 } 30 31 public string JustifyRejection(Type type) { 32 if (!ReflectionTools.HasDefaultConstructor(type) && 33 StorableConstructorAttribute.GetStorableConstructor(type) == null) 34 return "no default constructor and no storable constructor"; 35 while (type != null) { 36 if (StorableAttribute.GetStorableMembers(type, false).Count() == 0 && 37 !EmptyStorableClassAttribute.IsEmptyStorable(type)) 38 return string.Format("{0} has no storable members and is not marked [EmtpyStorableClass]", 39 type); 40 type = type.BaseType; 41 } 42 return "no reason"; 28 43 } 29 44
Note: See TracChangeset
for help on using the changeset viewer.