mono/MonoGame — pull request #2380 by JamesLupiani (2014-04-19 15:22:25+00:00)
Title: Implemented basic XmlImporter functionality

This covers much of the basic XmlImporter functionality. It supports reading from XML into any custom data type it can find in loaded assemblies. It supports all the integral types, generic collections, and the efficient array format for integers, vectors. It also handles polymorphic types and explicit type specifications for elements.

Also included are XML test data and corresponding classes I've been using to debug it. They're straight out of Sean Hargreaves' [Everything you ever wanted to know about IntermediateSerializer](http://blogs.msdn.com/b/shawnhar/archive/2008/08/12/everything-you-ever-wanted-to-know-about-intermediateserializer.aspx). No unit tests yet, but it's a step towards it.

Stuff I haven't implemented yet:
- Custom names for elements
- Flattened content for nested classes
- Shared resources
- External references
- Error checking for elements that are required to be null

Nothing too tough to do, I just ran out of time for now. Later passes can finish off these features. Additionally, if someone needs the IntermediateSerializer, they can refactor this code and create the writing end of it pretty easily.

Note that MonoGame doesn't currently have a ReflectiveWriter so AFAIK custom types will need a ContentTypeWriter defined.