XsltException.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //
  2. // System.Xml.Xsl.XsltException.cs
  3. //
  4. // Authors:
  5. // Tim Coleman ([email protected])
  6. // Andreas Nahr ([email protected])
  7. //
  8. // (C) Copyright 2002 Tim Coleman
  9. // (C) 2003 Andreas Nahr
  10. //
  11. using System;
  12. using System.Runtime.Serialization;
  13. namespace System.Xml.Xsl
  14. {
  15. [Serializable]
  16. public class XsltException : SystemException
  17. {
  18. #region Fields
  19. string message;
  20. int lineNumber;
  21. int linePosition;
  22. string sourceUri;
  23. #endregion
  24. #region Constructors
  25. public XsltException (string message, Exception innerException)
  26. : base (message, innerException)
  27. {
  28. this.message = message;
  29. }
  30. protected XsltException (SerializationInfo info, StreamingContext context)
  31. {
  32. lineNumber = info.GetInt32 ("lineNumber");
  33. linePosition = info.GetInt32 ("linePosition");
  34. sourceUri = info.GetString ("sourceUri");
  35. }
  36. internal XsltException (string message, Exception innerException, int lineNumber, int linePosition, string sourceUri)
  37. : base (message, innerException)
  38. {
  39. this.lineNumber = lineNumber;
  40. this.linePosition = linePosition;
  41. this.sourceUri = sourceUri;
  42. }
  43. #endregion
  44. #region Properties
  45. public int LineNumber {
  46. get { return lineNumber; }
  47. }
  48. public int LinePosition {
  49. get { return linePosition; }
  50. }
  51. public override string Message {
  52. get { return message; }
  53. }
  54. public string SourceUri {
  55. get { return sourceUri; }
  56. }
  57. #endregion
  58. #region Methods
  59. public override void GetObjectData (SerializationInfo info, StreamingContext context)
  60. {
  61. base.GetObjectData (info, context);
  62. info.AddValue ("lineNumber", lineNumber);
  63. info.AddValue ("linePosition", linePosition);
  64. info.AddValue ("sourceUri", sourceUri);
  65. }
  66. #endregion
  67. }
  68. }