Author: varadhan
Date: 2007-09-27 09:02:10 -0400 (Thu, 27 Sep 2007)
New Revision: 86491

Modified:
   trunk/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog
   trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlChars.cs
   trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlDecimal.cs
   trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlDouble.cs
   trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlInt16.cs
   trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlInt32.cs
   trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlInt64.cs
   trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlString.cs
Log:
* SqlDecimal.cs, SqlInt32.cs, SqlChars.cs, SqlInt16.cs, SqlInt64.cs,
  SqlString.cs, SqlDouble.cs (GetXsdType, GetSchema): Removed the
  extra XmlRootAttribute and GetXsdType will return appropriate
  modified root attribute for the XML Serializer.  Implemented
  missing 2.0 API.

Modified: trunk/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog  2007-09-27 
12:54:29 UTC (rev 86490)
+++ trunk/mcs/class/System.Data/System.Data.SqlTypes/ChangeLog  2007-09-27 
13:02:10 UTC (rev 86491)
@@ -1,3 +1,11 @@
+2007-09-27  Veerapuram Varadhan <[EMAIL PROTECTED]> 
+
+       * SqlDecimal.cs, SqlInt32.cs, SqlChars.cs, SqlInt16.cs, SqlInt64.cs,
+         SqlString.cs, SqlDouble.cs (GetXsdType, GetSchema): Removed the
+         extra XmlRootAttribute and GetXsdType will return appropriate
+         modified root attribute for the XML Serializer.  Implemented
+         missing 2.0 API.
+
 2007-09-25  Veerapuram Varadhan  <[EMAIL PROTECTED]>
 
        * SqlChars.cs (ReadXml, WriteXml): Implemented APIs.

Modified: trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlChars.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlChars.cs        
2007-09-27 12:54:29 UTC (rev 86490)
+++ trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlChars.cs        
2007-09-27 13:02:10 UTC (rev 86491)
@@ -44,7 +44,6 @@
 {
        [SerializableAttribute]
        [XmlSchemaProvider ("GetXsdType")]
-       [XmlRootAttribute ("string")]
        public sealed class SqlChars : INullable, IXmlSerializable, 
ISerializable
        {
                #region Fields
@@ -213,14 +212,19 @@
 
                public static XmlQualifiedName GetXsdType (XmlSchemaSet 
schemaSet)
                {
-                       XmlQualifiedName qualifiedName = new XmlQualifiedName 
("string", "http://www.w3.org/2001/XMLSchema";);
-                       return qualifiedName;
+                       if (schemaSet != null && schemaSet.Count == 0) {
+                               XmlSchema xs = new XmlSchema ();
+                               XmlSchemaComplexType ct = new 
XmlSchemaComplexType ();
+                               ct.Name = "string";
+                               xs.Items.Add (ct);
+                               schemaSet.Add (xs);
+                       }
+                       return new XmlQualifiedName ("string", 
"http://www.w3.org/2001/XMLSchema";);
                }
                
-               [MonoTODO]
                XmlSchema IXmlSerializable.GetSchema ()
                {
-                       throw new NotImplementedException ();
+                       return null;
                }
                
                void IXmlSerializable.ReadXml (XmlReader reader)

Modified: trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlDecimal.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlDecimal.cs      
2007-09-27 12:54:29 UTC (rev 86490)
+++ trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlDecimal.cs      
2007-09-27 13:02:10 UTC (rev 86491)
@@ -46,7 +46,6 @@
 #if NET_2_0
        [SerializableAttribute]
        [XmlSchemaProvider ("GetXsdType")]
-       [XmlRootAttribute ("decimal")]
 #endif
        public struct SqlDecimal : INullable, IComparable
 #if NET_2_0
@@ -1479,14 +1478,19 @@
 #if NET_2_0
                public static XmlQualifiedName GetXsdType (XmlSchemaSet 
schemaSet)
                {
-                       XmlQualifiedName qualifiedName = new XmlQualifiedName 
("decimal", "http://www.w3.org/2001/XMLSchema";);
-                       return qualifiedName;
+                       if (schemaSet != null && schemaSet.Count == 0) {
+                               XmlSchema xs = new XmlSchema ();
+                               XmlSchemaComplexType ct = new 
XmlSchemaComplexType ();
+                               ct.Name = "decimal";
+                               xs.Items.Add (ct);
+                               schemaSet.Add (xs);
+                       }
+                       return new XmlQualifiedName ("decimal", 
"http://www.w3.org/2001/XMLSchema";);
                }
                
-               [MonoTODO]
                XmlSchema IXmlSerializable.GetSchema ()
                {
-                       throw new NotImplementedException ();
+                       return null;
                }
                
                void IXmlSerializable.ReadXml (XmlReader reader)

Modified: trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlDouble.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlDouble.cs       
2007-09-27 12:54:29 UTC (rev 86490)
+++ trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlDouble.cs       
2007-09-27 13:02:10 UTC (rev 86491)
@@ -417,14 +417,19 @@
 #if NET_2_0
                public static XmlQualifiedName GetXsdType (XmlSchemaSet 
schemaSet)
                {
-                       XmlQualifiedName qualifiedName = new XmlQualifiedName 
("double", "http://www.w3.org/2001/XMLSchema";);
-                       return qualifiedName;
+                       if (schemaSet != null && schemaSet.Count == 0) {
+                               XmlSchema xs = new XmlSchema ();
+                               XmlSchemaComplexType ct = new 
XmlSchemaComplexType ();
+                               ct.Name = "double";
+                               xs.Items.Add (ct);
+                               schemaSet.Add (xs);
+                       }
+                       return new XmlQualifiedName ("double", 
"http://www.w3.org/2001/XMLSchema";);
                }
 
-               [MonoTODO]
                XmlSchema IXmlSerializable.GetSchema ()
                {
-                       throw new NotImplementedException ();
+                       return null;
                }
                
                void IXmlSerializable.ReadXml (XmlReader reader)

Modified: trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlInt16.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlInt16.cs        
2007-09-27 12:54:29 UTC (rev 86490)
+++ trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlInt16.cs        
2007-09-27 13:02:10 UTC (rev 86491)
@@ -42,7 +42,6 @@
 #if NET_2_0
        [SerializableAttribute]
        [XmlSchemaProvider ("GetXsdType")]
-       [XmlRootAttribute ("short")]
 #endif
        public struct SqlInt16 : INullable, IComparable
 #if NET_2_0
@@ -483,14 +482,19 @@
 #if NET_2_0
                public static XmlQualifiedName GetXsdType (XmlSchemaSet 
schemaSet)
                {
-                       XmlQualifiedName qualifiedName = new XmlQualifiedName 
("short", "http://www.w3.org/2001/XMLSchema";);
-                       return qualifiedName;
+                       if (schemaSet != null && schemaSet.Count == 0) {
+                               XmlSchema xs = new XmlSchema ();
+                               XmlSchemaComplexType ct = new 
XmlSchemaComplexType ();
+                               ct.Name = "short";
+                               xs.Items.Add (ct);
+                               schemaSet.Add (xs);
+                       }
+                       return new XmlQualifiedName ("short", 
"http://www.w3.org/2001/XMLSchema";);
                }
 
-               [MonoTODO]
                XmlSchema IXmlSerializable.GetSchema ()
                {
-                       throw new NotImplementedException ();
+                       return null;
                }
        
                void IXmlSerializable.ReadXml (XmlReader reader)

Modified: trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlInt32.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlInt32.cs        
2007-09-27 12:54:29 UTC (rev 86490)
+++ trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlInt32.cs        
2007-09-27 13:02:10 UTC (rev 86491)
@@ -50,7 +50,6 @@
 #if NET_2_0
        [SerializableAttribute]
        [XmlSchemaProvider ("GetXsdType")]
-       [XmlRootAttribute ("int")]
 #endif
        public struct SqlInt32 : INullable, IComparable 
 #if NET_2_0
@@ -502,14 +501,19 @@
 #if NET_2_0
                public static XmlQualifiedName GetXsdType (XmlSchemaSet 
schemaSet)
                {
-                       XmlQualifiedName qualifiedName = new XmlQualifiedName 
("int", "http://www.w3.org/2001/XMLSchema";);
-                       return qualifiedName;
+                       if (schemaSet != null && schemaSet.Count == 0) {
+                               XmlSchema xs = new XmlSchema ();
+                               XmlSchemaComplexType ct = new 
XmlSchemaComplexType ();
+                               ct.Name = "int";
+                               xs.Items.Add (ct);
+                               schemaSet.Add (xs);
+                       }
+                       return new XmlQualifiedName ("int", 
"http://www.w3.org/2001/XMLSchema";);
                }
 
-               [MonoTODO]
                XmlSchema IXmlSerializable.GetSchema ()
                {
-                       throw new NotImplementedException ();
+                       return null;
                }
                
                void IXmlSerializable.ReadXml (XmlReader reader)

Modified: trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlInt64.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlInt64.cs        
2007-09-27 12:54:29 UTC (rev 86490)
+++ trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlInt64.cs        
2007-09-27 13:02:10 UTC (rev 86491)
@@ -42,7 +42,6 @@
 #if NET_2_0
        [SerializableAttribute]
        [XmlSchemaProvider ("GetXsdType")]
-       [XmlRootAttribute ("long")]
 #endif
        public struct SqlInt64 : INullable, IComparable
 #if NET_2_0
@@ -482,14 +481,19 @@
 #if NET_2_0
                public static XmlQualifiedName GetXsdType (XmlSchemaSet 
schemaSet)
                {
-                       XmlQualifiedName qualifiedName = new XmlQualifiedName 
("long", "http://www.w3.org/2001/XMLSchema";);
-                       return qualifiedName;
+                       if (schemaSet != null && schemaSet.Count == 0) {
+                               XmlSchema xs = new XmlSchema ();
+                               XmlSchemaComplexType ct = new 
XmlSchemaComplexType ();
+                               ct.Name = "long";
+                               xs.Items.Add (ct);
+                               schemaSet.Add (xs);
+                       }
+                       return new XmlQualifiedName ("long", 
"http://www.w3.org/2001/XMLSchema";);
                }
 
-               [MonoTODO]
                XmlSchema IXmlSerializable.GetSchema ()
                {
-                       throw new NotImplementedException ();
+                       return null;
                }
                
                void IXmlSerializable.ReadXml (XmlReader reader)

Modified: trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlString.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlString.cs       
2007-09-27 12:54:29 UTC (rev 86490)
+++ trunk/mcs/class/System.Data/System.Data.SqlTypes/SqlString.cs       
2007-09-27 13:02:10 UTC (rev 86491)
@@ -602,14 +602,19 @@
 #if NET_2_0
                public static XmlQualifiedName GetXsdType (XmlSchemaSet 
schemaSet)
                {
-                       XmlQualifiedName qualifiedName = new XmlQualifiedName 
("string", "http://www.w3.org/2001/XMLSchema";);
-                       return qualifiedName;
+                       if (schemaSet != null && schemaSet.Count == 0) {
+                               XmlSchema xs = new XmlSchema ();
+                               XmlSchemaComplexType ct = new 
XmlSchemaComplexType ();
+                               ct.Name = "string";
+                               xs.Items.Add (ct);
+                               schemaSet.Add (xs);
+                       }
+                       return new XmlQualifiedName ("string", 
"http://www.w3.org/2001/XMLSchema";);
                }
 
-               [MonoTODO]
                XmlSchema IXmlSerializable.GetSchema ()
                {
-                       throw new NotImplementedException ();
+                       return null;
                }
                
                void IXmlSerializable.ReadXml (XmlReader reader)

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to