public void Collection <T, CollectionType>(CollectionType data, string name, ListElementWriter <T> writeElementWithName) where CollectionType : ICollection <T> { EnumerableSerializerWrapper <T, CollectionType> sColl = new EnumerableSerializerWrapper <T, CollectionType>(); sColl.Data = data; sColl.ElementWriter = writeElementWithName; Structure(sColl, name); }
public CollectionType Collection <T, CollectionType>(string name, ListElementReader <T> readElementWithName, Func <int, CollectionType> createWithCapacity, Action <int, CollectionType, T> insertAtEnd = null) where CollectionType : ICollection <T> { EnumerableSerializerWrapper <T, CollectionType> sColl = new EnumerableSerializerWrapper <T, CollectionType>(); sColl.ElementReader = readElementWithName; sColl.CollectionFactoryFromCapacity = createWithCapacity; sColl.InsertAtEnd = insertAtEnd; Structure(sColl, name); return(sColl.Data); }