[genmdesc] Fixed generator to allow instructions lengths equal to 0.
[mono.git] / mcs / class / System.Data / System.Data / DBConcurrencyException.cs
1 //
2 // System.Data.DBConcurrencyException.cs
3 //
4 // Author: Duncan Mak  (duncan@ximian.com)
5 //
6 // (C) Ximian, Inc.
7
8 //
9 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
10 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 // 
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 // 
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30
31 using System;
32 using System.Globalization;
33 using System.Runtime.Serialization;
34
35 namespace System.Data
36 {
37         [Serializable]
38         public sealed class DBConcurrencyException : SystemException
39         {
40                 DataRow [] rows;
41
42                 #region Constructors
43
44                 public DBConcurrencyException ()
45                         : base ("Concurrency violation.")
46                 {
47                 }
48
49                 public DBConcurrencyException (string message)
50                         : base (message)
51                 {
52                 }
53
54                 public DBConcurrencyException (string message, Exception inner)
55                         : base (message, inner)
56                 {
57                 }
58
59                 public
60                 DBConcurrencyException (string message, Exception inner, DataRow[] dataRows)
61                         : base (message, inner)
62                 {
63                         rows = dataRows;
64                 }
65
66                 private DBConcurrencyException (SerializationInfo si, StreamingContext sc) : base(si, sc)
67                 {
68                 }
69
70                 #endregion // Constructors
71
72                 #region Properties
73
74                 public DataRow Row {
75                         get {
76                                 if (rows != null)
77                                         return rows [0];
78                                 return null;
79                         }
80                         set { rows = new DataRow [] { value };}
81                 }
82
83                 public int RowCount {
84                         get {
85                                 if (rows != null)
86                                         return rows.Length;
87                                 return 0;
88                         }
89                 }
90
91                 #endregion // Properties
92
93                 #region Methods
94
95                 [MonoTODO]
96                 public void CopyToRows (DataRow [] array)
97                 {
98                         throw new NotImplementedException ();
99                 }
100
101                 [MonoTODO]
102                 public void CopyToRows (DataRow [] array, int arrayIndex)
103                 {
104                         throw new NotImplementedException ();
105                 }
106                 public override void GetObjectData (SerializationInfo si, StreamingContext context)
107                 {
108                         if (si == null)
109                                 throw new ArgumentNullException ("si");
110
111                         base.GetObjectData (si, context);
112                 }
113
114                 #endregion // Methods
115         }
116 }