Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/10/10 16:37:52 (15 years ago)
Author:
epitzer
Message:

add justifications for rejecting a type for serialization in ICompositeSerializer (#548)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/EnumerableSerializer.cs

    r1823 r2993  
    2626    }
    2727
     28    public string JustifyRejection(Type type) {
     29      if (!ReflectionTools.HasDefaultConstructor(type))
     30        return "no default constructor";
     31      if (type.GetInterface(typeof(IEnumerable).FullName) == null)
     32        return "interface IEnumerable not implemented";
     33      if (type.GetMethod("Add") == null)
     34        return "no 'Add()' method";     
     35      return "no 'Add()' method with one argument";
     36    }
     37
    2838    public IEnumerable<Tag> CreateMetaInfo(object o) {
    2939      return new Tag[] { };
Note: See TracChangeset for help on using the changeset viewer.