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)
{
#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
#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