FileLoadException.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //
  2. // System.IO.FileLoadException.cs
  3. //
  4. // Author:
  5. // Paolo Molaro ([email protected])
  6. // Duncan Mak ([email protected])
  7. //
  8. // (C) 2001 Ximian, Inc. http://www.ximian.com
  9. //
  10. using System.Globalization;
  11. using System.Runtime.Serialization;
  12. namespace System.IO {
  13. [Serializable]
  14. public class FileLoadException : SystemException {
  15. // Fields
  16. string msg;
  17. Exception inner;
  18. string fileName;
  19. string fusionLog;
  20. // Constructors
  21. public FileLoadException ()
  22. : base (Locale.GetText ("I/O Error"))
  23. {
  24. msg = Locale.GetText ("I/O Error");
  25. }
  26. public FileLoadException (string message)
  27. : base (message)
  28. {
  29. msg = message;
  30. }
  31. public FileLoadException (string message, Exception inner)
  32. : base (message, inner)
  33. {
  34. msg = message;
  35. this.inner = inner;
  36. }
  37. protected FileLoadException (SerializationInfo info, StreamingContext context)
  38. {
  39. fileName = info.GetString ("FileLoad_FileName");
  40. fusionLog = info.GetString ("FileLoad_FusionLog");
  41. }
  42. // Properties
  43. public override string Message
  44. {
  45. get { return msg; }
  46. }
  47. public string FileName
  48. {
  49. get { return fileName; }
  50. }
  51. public string FusionLog
  52. {
  53. get { return fusionLog; }
  54. }
  55. // Methods
  56. public override void GetObjectData (SerializationInfo info, StreamingContext context)
  57. {
  58. base.GetObjectData (info, context);
  59. info.AddValue ("FileLoad_FileName", fileName);
  60. info.AddValue ("FileLoad_FusionLog", fusionLog);
  61. }
  62. }
  63. }