2010-03-26 Veerapuram Varadhan <vvaradhan@novell.com>
[mono.git] / mcs / class / System.Data / System.Data.SqlTypes / SqlBinary.cs
index 57fda1ae39c2fbf198c3620295e55b300ea289ef..940436bfcfab3b1d63d5237509b71a0d1ce93e70 100644 (file)
@@ -46,7 +46,7 @@ namespace System.Data.SqlTypes
        /// </summary>
 #if NET_2_0
        [SerializableAttribute]
-       [XmlSchemaProvider ("GetSchema")]
+       [XmlSchemaProvider ("GetXsdType")]
 #endif
        public struct SqlBinary : INullable, IComparable
 #if NET_2_0
@@ -112,6 +112,13 @@ namespace System.Data.SqlTypes
                #endregion
 
                #region Methods
+#if NET_2_0
+               public static SqlBinary Add (SqlBinary x, SqlBinary y)
+               {
+                       return (x + y);
+               }
+#endif
+
                public int CompareTo (object value)
                {
                        if (value == null)
@@ -141,8 +148,8 @@ namespace System.Data.SqlTypes
                {
                        if (!(value is SqlBinary))
                                return false;
-                       else if (this.IsNull && ((SqlBinary)value).IsNull)
-                               return true;
+                       else if (this.IsNull)
+                               return ((SqlBinary)value).IsNull;
                        else if (((SqlBinary)value).IsNull)
                                return false;
                        else
@@ -211,7 +218,6 @@ namespace System.Data.SqlTypes
 
                #region Operators
 
-               [MonoTODO]
                public static SqlBinary operator + (SqlBinary x, SqlBinary y) 
                {
                        byte [] b = new byte [x.Value.Length + y.Value.Length];
@@ -345,6 +351,12 @@ namespace System.Data.SqlTypes
                        return 0;
                }
 #if NET_2_0
+               public static XmlQualifiedName GetXsdType (XmlSchemaSet schemaSet)
+               {
+                       XmlQualifiedName qualifiedName = new XmlQualifiedName ("base64Binary", "http://www.w3.org/2001/XMLSchema");
+                       return qualifiedName;
+               }
+               
                [MonoTODO]
                XmlSchema IXmlSerializable.GetSchema ()
                {