Creating your own Serializable Collection classes in .Net 2.0

This is the requirement. I want a collection which looks like this in XML format and I want to be able to serialize it and deserialize it.

In Debugger it looks like this (Click image to enlarge):

Collection seen in Debugger

In XML, it should look like this (so that I can save the class to a database or send it through wire)

Collection in XML Format

In .Net 1.1, you would create collection classes and then you would implement IEnumerable, IEnumerator, ICollection etc etc etc. In .Net 2.0, all you need to do is :

  1. Imports System.Collections.ObjectModel


  2.  

    Sample Collection Class

     

     


  3.  

    To Serlialize/Serialize your class to a database you need functions like these :

     

     

  4. Save And Retrieve Methods

  5. The whole collection class is here –> Complete Collection Classes

     

     

     

  6. The CustomSerliazer class (which I have used to Serlize /Deserialize is here –> CustomXMLSerializer

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s