Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtsushi Eno <atsushieno@gmail.com>2007-11-02 19:25:26 +0300
committerAtsushi Eno <atsushieno@gmail.com>2007-11-02 19:25:26 +0300
commit439df4a604e868f14796cf5f153f70f6cda01676 (patch)
tree4bb788548e05bd22e9b338421963dd95c045a421 /mcs/class/System.XML/System.Xml.Serialization
parent151117371d08d44eeb805f77666b0e0b7f399af6 (diff)
2007-11-02 Atsushi Enomoto <atsushi@ximian.com>
* TypeTranslator.cs : for duration, rather use primitiveTypes than nameCache, and hence TimeSpan could be serialized just as custom type. Fixed bug #338705. * XmlSerializerTests.cs : added test for bug #338705. svn path=/trunk/mcs/; revision=88729
Diffstat (limited to 'mcs/class/System.XML/System.Xml.Serialization')
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/ChangeLog6
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/TypeTranslator.cs3
2 files changed, 7 insertions, 2 deletions
diff --git a/mcs/class/System.XML/System.Xml.Serialization/ChangeLog b/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
index 075baafe763..798cbf41c62 100644
--- a/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
+++ b/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
@@ -1,3 +1,9 @@
+2007-11-02 Atsushi Enomoto <atsushi@ximian.com>
+
+ * TypeTranslator.cs : for duration, rather use primitiveTypes than
+ nameCache, and hence TimeSpan could be serialized just as custom
+ type. Fixed bug #338705.
+
2007-11-01 Atsushi Enomoto <atsushi@ximian.com>
* XmlSchemaImporter.cs : simpleType is allowed to be imported.
diff --git a/mcs/class/System.XML/System.Xml.Serialization/TypeTranslator.cs b/mcs/class/System.XML/System.Xml.Serialization/TypeTranslator.cs
index efda1962c4e..fb3cedf86e3 100644
--- a/mcs/class/System.XML/System.Xml.Serialization/TypeTranslator.cs
+++ b/mcs/class/System.XML/System.Xml.Serialization/TypeTranslator.cs
@@ -108,8 +108,6 @@ namespace System.Xml.Serialization
nameCache.Add (typeof (byte[]), new TypeData (typeof (byte[]), "base64Binary", true));
nameCache.Add (typeof (XmlNode), new TypeData (typeof (XmlNode), "XmlNode", false));
nameCache.Add (typeof (XmlElement), new TypeData (typeof (XmlElement), "XmlElement", false));
- // The key type is wrong (must be string), but otherwise it cannot be added to Hashtable!
- nameCache.Add (typeof (TimeSpan), new TypeData (typeof (string), "duration", true));
primitiveTypes = new Hashtable();
ICollection types = nameCache.Values;
@@ -147,6 +145,7 @@ namespace System.Xml.Serialization
primitiveTypes.Add ("normalizedString", new TypeData (typeof (string), "normalizedString", true));
primitiveTypes.Add ("anyURI", new TypeData (typeof (string), "anyURI", true));
primitiveTypes.Add ("base64", new TypeData (typeof (byte[]), "base64", true));
+ primitiveTypes.Add ("duration", new TypeData (typeof (string), "duration", true));
#if NET_2_0
nullableTypes = Hashtable.Synchronized(new Hashtable ());