I have never been impressed with XML serialization, and the standard way that objects were serialized and deserialized. Most JSON serializers are written in C# and I wanted a VB implementation.
I found that serialization is easy. Deserialization can be very tricky. This serializer/deserializer can serialize public and private properties, with the ability to serialize and deserialize readonly properties (objects/structures), as well as interfaces with an appropriate TypeConverter attribute.
Additionally, to get a bit of performance for subsequent serialization and deserialization, object types are cached - that is, an object which describes how a specific type is serialized and deserialized is added to a dictionary. Performance was not a priority, however.
It's probably not perfect, but does a decent job for what I needed it to do (transmit a compact plain text object over a TCP connection, save the same representation to a non-xml text file, with the ability to *not* serialize through object fields but serialize/deserialize non-exposed properties).
There are 2 methods:
Serialize - Serializes the passed object, returning a string representation of that object.
Deserialize - deserializes the passed string to an object.
There are 2 properties:
Pretty - add indentation and line feeds to the serialized string.
MaximumDepth - the maximum depth that an object can be serialized (a crude method to prevent recursion).
Serialization is controlled through attributes:
JsonSerializationAttribute - controls how an object will be serialized, whether private properties are to be serialized.
JsonHideAttribute - hides a property from serialization.
"Ok, my response to that is pending a Google search" - Bucky Katt. "There are two types of people in the world: Those who can extrapolate from incomplete data sets." - Unk. "Before you can 'think outside the box' you need to understand where the box is."