Two questions about XMLSerializer.
http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer(VS.80).aspx
1.
It is mentioned -- "To increase performance, the XML serialization infrastructure dynamically generates assemblies to serialize and deserialize specified types."
What means the assemblies?
2.
For the following sample, why creates two XMLSerializer instances, one is s and the other is ser?
[Code]Hashtable serializers = new Hashtable();
// Use the constructor that takes a type and XmlRootAttribute.XmlSerializer s = new XmlSerializer(typeof(MyClass), myRoot);
// Implement a method named GenerateKey that creates unique keys // for each instance of the XmlSerializer. The code should take // into account all parameters passed to the XmlSerializer // constructor.object key = GenerateKey(typeof(MyClass), myRoot);
// Check the local cache for a matching serializer.XmlSerializer ser = (XmlSerializer)serializers[key];if (ser == null) { ser = new XmlSerializer(typeof(MyClass), myRoot); // Cache the serializer. serializers[key] = ser;}else{ // Use the serializer to serialize, or deserialize.}[/Code]
thanks in advance,George