2006-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / mcs / class / FirebirdSql.Data.Firebird / FirebirdSql.Data.Firebird / FbError.cs
1 /*
2  *      Firebird ADO.NET Data provider for .NET and Mono 
3  * 
4  *         The contents of this file are subject to the Initial 
5  *         Developer's Public License Version 1.0 (the "License"); 
6  *         you may not use this file except in compliance with the 
7  *         License. You may obtain a copy of the License at 
8  *         http://www.firebirdsql.org/index.php?op=doc&id=idpl
9  *
10  *         Software distributed under the License is distributed on 
11  *         an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 
12  *         express or implied. See the License for the specific 
13  *         language governing rights and limitations under the License.
14  * 
15  *      Copyright (c) 2002, 2005 Carlos Guzman Alvarez
16  *      All Rights Reserved.
17  */
18
19 using System;
20
21 namespace FirebirdSql.Data.Firebird
22 {
23         /// <include file='Doc/en_EN/FbError.xml' path='doc/class[@name="FbError"]/overview/*'/>
24 #if     (!NETCF)
25         [Serializable]
26 #endif
27         public sealed class FbError
28         {
29                 #region Fields
30
31                 private byte    classError;
32                 private int             lineNumber;
33                 private string  message;
34                 private int             number;
35
36                 #endregion
37
38                 #region Properties
39
40                 /// <include file='Doc/en_EN/FbError.xml' path='doc/class[@name="FbError"]/property[@name="Class"]/*'/>
41                 public byte Class
42                 {
43                         get { return this.classError; }
44                 }
45
46                 /// <include file='Doc/en_EN/FbError.xml' path='doc/class[@name="FbError"]/property[@name="LineNumber"]/*'/>            
47                 public int LineNumber
48                 {
49                         get { return this.lineNumber; }
50                 }
51
52                 /// <include file='Doc/en_EN/FbError.xml' path='doc/class[@name="FbError"]/property[@name="Message"]/*'/>
53                 public string Message
54                 {
55                         get { return this.message; }
56                 }
57
58                 /// <include file='Doc/en_EN/FbError.xml' path='doc/class[@name="FbError"]/property[@name="Number"]/*'/>
59                 public int Number
60                 {
61                         get { return this.number; }
62                 }
63
64                 #endregion
65
66                 #region Constructors
67
68                 internal FbError(string message, int number)
69                         : this(0, 0, message, number)
70                 {
71                 }
72
73                 internal FbError(byte classError, string message, int number)
74                         : this(classError, 0, message, number)
75                 {
76                 }
77
78                 internal FbError(byte classError, int line, string message, int number)
79                 {
80                         this.classError = classError;
81                         this.lineNumber = line;
82                         this.number             = number;
83                         this.message    = message;
84                 }
85
86                 #endregion
87         }
88 }