2
// System.Web.Compilation.Location
5
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
7
// (C) 2003 Ximian, Inc (http://www.ximian.com)
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:
19
// The above copyright notice and this permission notice shall be
20
// included in all copies or substantial portions of the Software.
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.
31
using MonoDevelop.AspNet.Parser.Dom;
33
namespace MonoDevelop.AspNet.Parser.Internal
35
class Location : ILocation
37
int beginLine, endLine, beginColumn, endColumn;
38
string fileName, plainText;
45
public Location (ILocation location)
50
public void Init (ILocation location)
52
if (location == null) {
60
beginLine = location.BeginLine;
61
endLine = location.EndLine;
62
beginColumn = location.BeginColumn;
63
endColumn = location.EndColumn;
64
fileName = location.Filename;
65
plainText = location.PlainText;
67
this.location = location;
70
public string Filename {
71
get { return fileName; }
72
set { fileName = value; }
75
public int BeginLine {
76
get { return beginLine; }
77
set { beginLine = value; }
81
get { return endLine; }
82
set { endLine = value; }
85
public int BeginColumn {
86
get { return beginColumn; }
87
set { beginColumn = value; }
90
public int EndColumn {
91
get { return endColumn; }
92
set { endColumn = value; }
95
public string PlainText {
96
get { return plainText; }
97
set { plainText = value; }
100
public override string ToString ()
102
return string.Format ("{0}({1},{2}-{3},{4})",
103
System.IO.Path.GetFileName (Filename), BeginLine, BeginColumn, EndLine, EndColumn);
106
public string FileText {
108
if (location != null)
109
return location.FileText;