mscorlib(4.0.0.0) API with additions
CompilerError.cs
3 
5 {
8  [PermissionSet(SecurityAction.InheritanceDemand, Name = "FullTrust")]
9  public class CompilerError
10  {
11  private int line;
12 
13  private int column;
14 
15  private string errorNumber;
16 
17  private bool warning;
18 
19  private string errorText;
20 
21  private string fileName;
22 
25  public int Line
26  {
27  get
28  {
29  return line;
30  }
31  set
32  {
33  line = value;
34  }
35  }
36 
39  public int Column
40  {
41  get
42  {
43  return column;
44  }
45  set
46  {
47  column = value;
48  }
49  }
50 
53  public string ErrorNumber
54  {
55  get
56  {
57  return errorNumber;
58  }
59  set
60  {
61  errorNumber = value;
62  }
63  }
64 
67  public string ErrorText
68  {
69  get
70  {
71  return errorText;
72  }
73  set
74  {
75  errorText = value;
76  }
77  }
78 
82  public bool IsWarning
83  {
84  get
85  {
86  return warning;
87  }
88  set
89  {
90  warning = value;
91  }
92  }
93 
96  public string FileName
97  {
98  get
99  {
100  return fileName;
101  }
102  set
103  {
104  fileName = value;
105  }
106  }
107 
109  public CompilerError()
110  {
111  line = 0;
112  column = 0;
113  errorNumber = string.Empty;
114  errorText = string.Empty;
115  fileName = string.Empty;
116  }
117 
124  public CompilerError(string fileName, int line, int column, string errorNumber, string errorText)
125  {
126  this.line = line;
127  this.column = column;
128  this.errorNumber = errorNumber;
129  this.errorText = errorText;
130  this.fileName = fileName;
131  }
132 
135  public override string ToString()
136  {
137  if (FileName.Length > 0)
138  {
139  return string.Format(CultureInfo.InvariantCulture, "{0}({1},{2}) : {3} {4}: {5}", FileName, Line, Column, IsWarning ? "warning" : "error", ErrorNumber, ErrorText);
140  }
141  return string.Format(CultureInfo.InvariantCulture, "{0} {1}: {2}", new object[3]
142  {
143  IsWarning ? "warning" : "error",
144  ErrorNumber,
145  ErrorText
146  });
147  }
148  }
149 }
static CultureInfo InvariantCulture
Gets the T:System.Globalization.CultureInfo object that is culture-independent (invariant).
Definition: CultureInfo.cs:263
int Line
Gets or sets the line number where the source of the error occurs.
string ErrorNumber
Gets or sets the error number.
Represents a compiler error or warning.
Definition: CompilerError.cs:9
string ErrorText
Gets or sets the text of the error message.
Definition: __Canon.cs:3
SecurityAction
Specifies the security actions that can be performed using declarative security.
override string ToString()
Provides an implementation of Object's M:System.Object.ToString method.
string FileName
Gets or sets the file name of the source file that contains the code which caused the error.
bool IsWarning
Gets or sets a value that indicates whether the error is a warning.
Specifies that the class can be serialized.
CompilerError()
Initializes a new instance of the T:System.CodeDom.Compiler.CompilerError class.
Provides information about a specific culture (called a locale for unmanaged code development)....
Definition: CultureInfo.cs:16
CompilerError(string fileName, int line, int column, string errorNumber, string errorText)
Initializes a new instance of the T:System.CodeDom.Compiler.CompilerError class using the specified f...
int Column
Gets or sets the column number where the source of the error occurs.