System.Drawing: added email to icon and test file headers
[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 #if NET_2_0
46                         : base ("Concurrency violation.")
47 #endif
48                 {
49                 }
50
51                 public DBConcurrencyException (string message)
52                         : base (message)
53                 {
54                 }
55
56                 public DBConcurrencyException (string message, Exception inner)
57                         : base (message, inner)
58                 {
59                 }
60
61 #if NET_2_0
62                 public
63 #else
64                 internal
65 #endif
66                 DBConcurrencyException (string message, Exception inner, DataRow[] dataRows)
67                         : base (message, inner)
68                 {
69                         rows = dataRows;
70                 }
71
72                 private DBConcurrencyException (SerializationInfo si, StreamingContext sc) : base(si, sc)
73                 {
74                 }
75
76                 #endregion // Constructors
77
78                 #region Properties
79
80                 public DataRow Row {
81                         get {
82                                 if (rows != null)
83                                         return rows [0];
84                                 return null;
85                         }
86                         set { rows = new DataRow [] { value };}
87                 }
88
89 #if NET_2_0
90                 public int RowCount {
91                         get {
92                                 if (rows != null)
93                                         return rows.Length;
94                                 return 0;
95                         }
96                 }
97 #endif
98
99                 #endregion // Properties
100
101                 #region Methods
102
103 #if NET_2_0
104                 [MonoTODO]
105                 public void CopyToRows (DataRow [] array)
106                 {
107                         throw new NotImplementedException ();
108                 }
109
110                 [MonoTODO]
111                 public void CopyToRows (DataRow [] array, int ArrayIndex)
112                 {
113                         throw new NotImplementedException ();
114                 }
115 #endif
116                 public override void GetObjectData (SerializationInfo si, StreamingContext context)
117                 {
118                         if (si == null)
119                                 throw new ArgumentNullException ("si");
120
121                         base.GetObjectData (si, context);
122                 }
123
124                 #endregion // Methods
125         }
126 }