2003-10-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / mcs / class / System.Web / System.Web.Compilation / Location.cs
1 //
2 // System.Web.Compilation.Location
3 //
4 // Authors:
5 //      Gonzalo Paniagua Javier (gonzalo@ximian.com)
6 //
7 // (C) 2003 Ximian, Inc (http://www.ximian.com)
8 //
9
10 namespace System.Web.Compilation
11 {
12         class Location : ILocation
13         {
14                 int beginLine, endLine, beginColumn, endColumn;
15                 string fileName, plainText;
16
17                 public Location (ILocation location)
18                 {
19                         Init (location);
20                 }
21
22                 public void Init (ILocation location)
23                 {
24                         if (location == null) {
25                                 beginLine = 0;
26                                 endLine = 0;
27                                 beginColumn = 0;
28                                 endColumn = 0;
29                                 fileName = null;
30                                 plainText = null;
31                         } else {
32                                 beginLine = location.BeginLine;
33                                 endLine = location.EndLine;
34                                 beginColumn = location.BeginColumn;
35                                 endColumn = location.EndColumn;
36                                 fileName = location.Filename;
37                                 plainText = location.PlainText;
38                         }
39                 }
40
41                 public string Filename {
42                         get { return fileName; }
43                 }
44
45                 public int BeginLine {
46                         get { return beginLine; }
47                 }
48
49                 public int EndLine {
50                         get { return endLine; }
51                 }
52
53                 public int BeginColumn {
54                         get { return beginColumn; }
55                 }
56
57                 public int EndColumn {
58                         get { return endColumn; }
59                 }
60
61                 public string PlainText {
62                         get { return plainText; }
63                 }
64         }
65 }
66