~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric-updates

« back to all changes in this revision

Viewing changes to src/core/MonoDevelop.Projects/MonoDevelop.Projects.Formats.MSBuild.Conditions/InvalidProjectFileException.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2009-02-18 08:40:51 UTC
  • mfrom: (1.2.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090218084051-gh8m6ukvokbwj7cf
Tags: 1.9.2+dfsg-1ubuntu1
* Merge from Debian Experimental (LP: #330519), remaining Ubuntu changes:
  + debian/control:
    - Update for Gnome# 2.24
    - Add libmono-cairo1.0-cil to build-deps to fool pkg-config check

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// InvalidProjectFileException.cs:
 
3
//
 
4
// Author:
 
5
//   Marek Sieradzki (marek.sieradzki@gmail.com)
 
6
// 
 
7
// (C) 2005 Marek Sieradzki
 
8
//
 
9
// Permission is hereby granted, free of charge, to any person obtaining
 
10
// a copy of this software and associated documentation files (the
 
11
// "Software"), to deal in the Software without restriction, including
 
12
// without limitation the rights to use, copy, modify, merge, publish,
 
13
// distribute, sublicense, and/or sell copies of the Software, and to
 
14
// permit persons to whom the Software is furnished to do so, subject to
 
15
// the following conditions:
 
16
//
 
17
// The above copyright notice and this permission notice shall be
 
18
// included in all copies or substantial portions of the Software.
 
19
//
 
20
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 
21
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
22
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 
23
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 
24
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 
25
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 
26
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
27
 
 
28
 
 
29
 
 
30
using System;
 
31
using System.Runtime.Serialization;
 
32
using System.Security.Permissions;
 
33
using System.Xml;
 
34
 
 
35
namespace Microsoft.Build.BuildEngine {
 
36
        [Serializable]
 
37
        public sealed class InvalidProjectFileException : Exception {
 
38
                
 
39
                int     columnNumber;
 
40
                int     endColumnNumber;
 
41
                string  errorCode;
 
42
                string  errorSubcategory;
 
43
                string  helpKeyword;
 
44
                int     lineNumber;
 
45
                int     endLineNumber;
 
46
                string  projectFile;
 
47
                
 
48
                public InvalidProjectFileException ()
 
49
                        : base ("Invalid project file exception has occured")
 
50
                {
 
51
                }
 
52
 
 
53
                public InvalidProjectFileException (string message)
 
54
                        : base (message)
 
55
                {
 
56
                }
 
57
 
 
58
                public InvalidProjectFileException (string projectFile,
 
59
                                                    int lineNumber,
 
60
                                                    int columnNumber,
 
61
                                                    int endLineNumber,
 
62
                                                    int endColumnNumber,
 
63
                                                    string message,
 
64
                                                    string errorSubcategory,
 
65
                                                    string errorCode,
 
66
                                                    string helpKeyword)
 
67
                        : base (message)
 
68
                {
 
69
                        this.projectFile = projectFile;
 
70
                        this.lineNumber = lineNumber;
 
71
                        this.columnNumber = columnNumber;
 
72
                        this.endLineNumber = endLineNumber;
 
73
                        this.endColumnNumber = endColumnNumber;
 
74
                        this.errorSubcategory = errorSubcategory;
 
75
                        this.errorCode = errorCode;
 
76
                        this.helpKeyword = helpKeyword;
 
77
                }
 
78
 
 
79
                public InvalidProjectFileException (string message,
 
80
                                                    Exception innerException)
 
81
                        : base (message, innerException)
 
82
                {
 
83
                }
 
84
 
 
85
                // FIXME: set line/column numbers?
 
86
                public InvalidProjectFileException (XmlNode xmlNode,
 
87
                                                    string message,
 
88
                                                    string errorSubcategory,
 
89
                                                    string errorCode,
 
90
                                                    string helpKeyword)
 
91
                        : base (message)
 
92
                {
 
93
                        this.errorSubcategory = errorSubcategory;
 
94
                        this.errorCode = errorCode;
 
95
                        this.helpKeyword = helpKeyword;
 
96
                }
 
97
 
 
98
                // FIXME: private temporarily
 
99
                private InvalidProjectFileException (SerializationInfo info, StreamingContext context)
 
100
                        : base (info, context)
 
101
                {
 
102
                        this.columnNumber = info.GetInt32 ("columnNumber");
 
103
                        this.endColumnNumber = info.GetInt32 ("endColumnNumber");
 
104
                        this.errorCode = info.GetString ("errorCode");
 
105
                        this.errorSubcategory = info.GetString ("errorSubcategory");
 
106
                        this.helpKeyword = info.GetString ("helpKeyword");
 
107
                        this.lineNumber = info.GetInt32 ("lineNumber");
 
108
                        this.endLineNumber = info.GetInt32 ("endLineNumber");
 
109
                        this.projectFile = info.GetString ("projectFile");
 
110
                }
 
111
 
 
112
                [SecurityPermission (SecurityAction.LinkDemand, SerializationFormatter = true)]
 
113
                public override void GetObjectData (SerializationInfo info,
 
114
                                                    StreamingContext context)
 
115
                {
 
116
                        base.GetObjectData (info, context);
 
117
                        info.AddValue ("columnNumber", columnNumber);
 
118
                        info.AddValue ("endColumnNumber", endColumnNumber);
 
119
                        info.AddValue ("errorCode", errorCode);
 
120
                        info.AddValue ("errorSubcategory", errorSubcategory);
 
121
                        info.AddValue ("helpKeyword", helpKeyword);
 
122
                        info.AddValue ("lineNumber", lineNumber);
 
123
                        info.AddValue ("endLineNumber", endLineNumber);
 
124
                        info.AddValue ("projectFile", projectFile);
 
125
                }
 
126
 
 
127
                public string BaseMessage {
 
128
                        get {
 
129
                                return base.Message;
 
130
                        }
 
131
                }
 
132
 
 
133
                public int ColumnNumber {
 
134
                        get {
 
135
                                return columnNumber;
 
136
                        }
 
137
                }
 
138
 
 
139
                public int EndColumnNumber {
 
140
                        get {
 
141
                                return endColumnNumber;
 
142
                        }
 
143
                }
 
144
 
 
145
                public int EndLineNumber {
 
146
                        get {
 
147
                                return endLineNumber;
 
148
                        }
 
149
                }
 
150
 
 
151
                public string ErrorCode {
 
152
                        get {
 
153
                                return errorCode;
 
154
                        }
 
155
                }
 
156
 
 
157
                public string ErrorSubcategory {
 
158
                        get {
 
159
                                return errorSubcategory;
 
160
                        }
 
161
                }
 
162
 
 
163
                public string HelpKeyword {
 
164
                        get {
 
165
                                return helpKeyword;
 
166
                        }
 
167
                }
 
168
 
 
169
                public int LineNumber {
 
170
                        get {
 
171
                                return lineNumber;
 
172
                        }
 
173
                }
 
174
 
 
175
                public override string Message {
 
176
                        get {
 
177
                                if (projectFile == null || projectFile == String.Empty) {
 
178
                                        return BaseMessage;
 
179
                                } else {
 
180
                                        return BaseMessage + "  " + ProjectFile;
 
181
                                }
 
182
                        }
 
183
                }
 
184
 
 
185
                public string ProjectFile {
 
186
                        get {
 
187
                                return projectFile;
 
188
                        }
 
189
                }
 
190
        }
 
191
}
 
192