Skip to main content
GameDev.net gamedev.net
🔒 Locked

Generic xml serializer class that can serialize dictionaries

Started by dechorus Jan 22, 2012 at 8:33 PM 0 replies 1.4k views
Original Post
dechorus
dechorus
[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

Hello,

[/font]

[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

I've searched and searched the net for serializer classes that do as the topic describes, but have found none. Is anybody out there using a serializer class that can take care of everything for them? The best I got -- I have to specify an array of all other custom classes that the object I'm trying to serialize contains, and even then, it cannot serialize dictionaries, since they're not supported. Using this class also doesn't serialize private objects, for obvious reasons, but I'd like to know if there is a way to serialize them using a helper class.

[/font]

[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

How do you handle your XML Serialization?

[/font]

[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

Is having a single class to take care of everything possible? If anybody can point to some classes I could download or code online, that would be great. Your personal solutions would also be appreciated.

[/font]

Don Carnage
Don Carnage
Some pages and examples I found to get you on your way:

http://theburningmonk.com/2010/05/net-tips-xml-serialize-or-deserialize-dictionary-in-csharp/
http://weblogs.asp.net/pwelter34/archive/2006/05/03/444961.aspx
http://blogs.msdn.com/b/adam/archive/2010/09/10/how-to-serialize-a-dictionary-or-hashtable-in-c.aspx
http://stackoverflow.com/questions/1124597/why-isnt-there-an-xml-serializable-dictionary-in-net
http://www.jankowskimichal.pl/en/2010/10/serializabledictionary/
It is I, the spectaculous Don Karnage! My bloodthirsty horde is on an intercept course with you. We will be shooting you and looting you in precisely... Ten minutes. Felicitations!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.