CompilerError.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //
  2. // System.CodeDom.Compiler.CompilerError
  3. //
  4. // Authors:
  5. // Gonzalo Paniagua Javier ([email protected])
  6. //
  7. // (C) 2002 Ximian, Inc (http://www.ximian.com)
  8. //
  9. using System;
  10. namespace System.CodeDom.Compiler
  11. {
  12. public class CompilerError
  13. {
  14. string fileName;
  15. int line;
  16. int column;
  17. string errorNumber;
  18. string errorText;
  19. bool isWarning = false;
  20. public CompilerError () :
  21. this (String.Empty, 0, 0, String.Empty, String.Empty)
  22. {
  23. }
  24. public CompilerError (string fileName, int line, int column, string errorNumber, string errorText)
  25. {
  26. this.fileName = fileName;
  27. this.line = line;
  28. this.column = column;
  29. this.errorNumber = errorNumber;
  30. this.errorText = errorText;
  31. }
  32. public override string ToString ()
  33. {
  34. string type = isWarning ? "warning" : "error";
  35. return String.Format ("{0}({1},{2}) : {3} {4}: {5}", fileName, line, column, type,
  36. errorNumber, errorText);
  37. }
  38. public int Line
  39. {
  40. get { return line; }
  41. set { line = value; }
  42. }
  43. public int Column
  44. {
  45. get { return column; }
  46. set { column = value; }
  47. }
  48. public string ErrorNumber
  49. {
  50. get { return errorNumber; }
  51. set { errorNumber = value; }
  52. }
  53. public string ErrorText
  54. {
  55. get { return errorText; }
  56. set { errorText = value; }
  57. }
  58. public bool IsWarning
  59. {
  60. get { return isWarning; }
  61. set { isWarning = value; }
  62. }
  63. public string FileName
  64. {
  65. get { return fileName; }
  66. set { fileName = value; }
  67. }
  68. }
  69. }