New tests, updates
[mono.git] / mcs / class / System.Data / System.Data / DBConcurrencyException.cs
index 145988e598c95ba099113f32a43d2d39ba8902c0..78d408acf6eccedeacc44ff65ad686edc74b65ce 100644 (file)
@@ -32,35 +32,42 @@ using System;
 using System.Globalization;
 using System.Runtime.Serialization;
 
-namespace System.Data {
+namespace System.Data
+{
        [Serializable]
        public sealed class DBConcurrencyException : SystemException
        {
-               DataRow row;
+               DataRow [] rows;
 
                #region Constructors
-#if NET_1_1
-                public DBConcurrencyException ()
-                        : base ()
-                {
-                }
+
+               public DBConcurrencyException ()
+#if NET_2_0
+                       : base ("Concurrency violation.")
 #endif
+               {
+               }
+
                public DBConcurrencyException (string message)
                        : base (message)
                {
                }
 
-               public DBConcurrencyException (string message, Exception innerException)
-                       : base (message, innerException)
+               public DBConcurrencyException (string message, Exception inner)
+                       : base (message, inner)
                {
                }
 
 #if NET_2_0
-               public DBConcurrencyException (string message, Exception inner, DataRow[] dataRows)
+               public
+#else
+               internal
+#endif
+               DBConcurrencyException (string message, Exception inner, DataRow[] dataRows)
                        : base (message, inner)
                {
+                       rows = dataRows;
                }
-#endif
 
                private DBConcurrencyException (SerializationInfo si, StreamingContext sc) : base(si, sc)
                {
@@ -71,14 +78,21 @@ namespace System.Data {
                #region Properties
 
                public DataRow Row {
-                       get { return row; }
-                       set { row = value;} // setting the row has no effect
+                       get {
+                               if (rows != null)
+                                       return rows [0];
+                               return null;
+                       }
+                       set { rows = new DataRow [] { value };}
                }
 
 #if NET_2_0
-               [MonoTODO]
                public int RowCount {
-                       get { throw new NotImplementedException (); }
+                       get {
+                               if (rows != null)
+                                       return rows.Length;
+                               return 0;
+                       }
                }
 #endif
 
@@ -88,23 +102,23 @@ namespace System.Data {
 
 #if NET_2_0
                [MonoTODO]
-               public void CopyToRows (DataRow[] array)
+               public void CopyToRows (DataRow [] array)
                {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public void CopyToRows (DataRow[] array, int ArrayIndex)
+               public void CopyToRows (DataRow [] array, int ArrayIndex)
                {
                        throw new NotImplementedException ();
                }
 #endif
-               public override void GetObjectData (SerializationInfo info, StreamingContext context)
+               public override void GetObjectData (SerializationInfo si, StreamingContext context)
                {
-                       if (info == null)
-                               throw new ArgumentNullException ("info");
+                       if (si == null)
+                               throw new ArgumentNullException ("si");
 
-                       base.GetObjectData (info, context);
+                       base.GetObjectData (si, context);
                }
 
                #endregion // Methods