Mark tests as not working under TARGET_JVM
[mono.git] / mcs / class / System.Data / System.Data.SqlTypes / SqlBinary.cs
index 06983fbeeab1178ef7cad2083e5ab091e370f414..8aa790c14f0c39f7fe28ff6647c70388cb3fb191 100644 (file)
 //
 
 using System;
+using System.Xml;
+using System.Xml.Schema;
 using System.Globalization;
+using System.Xml.Serialization;
 
 namespace System.Data.SqlTypes
 {
        /// <summary>
        /// Represents a variable-length stream of binary data to be stored in or retrieved from a database.
        /// </summary>
+#if NET_2_0
+       [SerializableAttribute]
+       [XmlSchemaProvider ("GetSchema")]
+#endif
        public struct SqlBinary : INullable, IComparable
+#if NET_2_0
+                               , IXmlSerializable
+#endif
        {
 
                #region Fields
@@ -102,17 +112,31 @@ 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) 
+               public int CompareTo (object value)
                {
                        if (value == null)
                                return 1;
-                       else if (!(value is SqlBinary))
+                       if (!(value is SqlBinary))
                                throw new ArgumentException (Locale.GetText ("Value is not a System.Data.SqlTypes.SqlBinary"));
-                       else if (((SqlBinary)value).IsNull)
+
+                       return CompareTo ((SqlBinary) value);
+               }
+#if NET_2_0
+               public
+#endif
+               int CompareTo (SqlBinary value) 
+               {
+                       if (value.IsNull)
                                return 1;
                        else
-                               return Compare (this, (SqlBinary)value);
+                               return Compare (this, value);
                }
 
                public static SqlBinary Concat (SqlBinary x, SqlBinary y) 
@@ -194,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];
@@ -327,6 +350,30 @@ namespace System.Data.SqlTypes
                        // If we are here, x and y were same size
                        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 ()
+               {
+                       throw new NotImplementedException ();
+               }
+               
+               [MonoTODO]
+               void IXmlSerializable.ReadXml (XmlReader reader)
+               {
+                       throw new NotImplementedException ();
+               }
+               
+               [MonoTODO]
+               void IXmlSerializable.WriteXml (XmlWriter writer) 
+               {
+                       throw new NotImplementedException ();
+               }
+#endif
        }
 }