hi,
i wanna implement my own serialization, in order to control what's being saved.
i'm using reflection to iterate the fields and if they "tagged" with my custom attribute, i saved them to some file.
the problem occur with generics objects.
i detect collection member by check its interface [GetType().GetInterface("ICollection")] (or IList)
and then use [foreach (object objItem in (ICollection)objValue)] to iterate its items.
however, when i deserialize i don't know how to add the items i read to the member back again.
even if i save the object name and assembly and create it on the fly, the interface itself doesn't have Add() function so i can't fill my collection with the data.
what if the class contains other data structures like Stack, LinkedList etc??
is there a generic way to perform this kind of serialization?