System.Drawing: added email to icon and test file headers
[mono.git] / mcs / class / System.Data.OracleClient / System.Data.OracleClient / OracleException.cs
1 // 
2 // OracleException.cs
3 //
4 // Part of the Mono class libraries at
5 // mcs/class/System.Data.OracleClient/System.Data.OracleClient
6 //
7 // Assembly: System.Data.OracleClient.dll
8 // Namespace: System.Data.OracleClient
9 //
10 // Authors: 
11 //    Tim Coleman <tim@timcoleman.com>
12 //
13 // Copyright (C) Daniel Morgan, 2002
14 // Copyright (C) Tim Coleman , 2003
15 //
16 // Licensed under the MIT/X11 License.
17 //
18
19 using System;
20 using System.Runtime.Serialization;
21
22 namespace System.Data.OracleClient {
23         [Serializable]
24         public sealed class OracleException
25 #if NET_2_0
26                 : System.Data.Common.DbException
27 #else
28                 : SystemException
29 #endif //NET_1_1        
30         {
31                 #region Fields
32
33                 private int code;
34
35                 #endregion // Fields
36
37                 #region Constructors
38
39                 internal OracleException (int code, string message) : base (message)
40                 {
41                         this.code = code;
42                 }
43
44                 private OracleException (SerializationInfo si, StreamingContext sc) : base(si, sc)
45                 {
46                         code = si.GetInt32 ("code");
47                 }
48
49                 #endregion // Constructors
50
51                 #region Properties
52
53                 public int Code {
54                         get { return code; }
55                 }
56
57                 #endregion // Properties
58
59                 #region Override implementation of Exception
60
61                 public override void GetObjectData (SerializationInfo si, StreamingContext context)
62                 {
63                         si.AddValue ("code", code, typeof(int));
64                         base.GetObjectData (si, context);
65                 }
66
67                 #endregion Override implementation of Exception
68         }
69 }