2
0

FileLoadException.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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.IO;
  12. using System.Runtime.Serialization;
  13. namespace System.IO {
  14. [Serializable]
  15. public class FileLoadException : IOException {
  16. // Fields
  17. string msg;
  18. Exception inner;
  19. string fileName;
  20. string fusionLog;
  21. // Constructors
  22. public FileLoadException ()
  23. : base (Locale.GetText ("I/O Error"))
  24. {
  25. msg = Locale.GetText ("I/O Error");
  26. }
  27. public FileLoadException (string message)
  28. : base (message)
  29. {
  30. msg = message;
  31. }
  32. public FileLoadException (string message, Exception inner)
  33. : base (message, inner)
  34. {
  35. msg = message;
  36. this.inner = inner;
  37. }
  38. protected FileLoadException (SerializationInfo info, StreamingContext context)
  39. {
  40. fileName = info.GetString ("FileLoad_FileName");
  41. fusionLog = info.GetString ("FileLoad_FusionLog");
  42. }
  43. // Properties
  44. public override string Message
  45. {
  46. get { return msg; }
  47. }
  48. public string FileName
  49. {
  50. get { return fileName; }
  51. }
  52. public string FusionLog
  53. {
  54. get { return fusionLog; }
  55. }
  56. // Methods
  57. public override void GetObjectData (SerializationInfo info, StreamingContext context)
  58. {
  59. base.GetObjectData (info, context);
  60. info.AddValue ("FileLoad_FileName", fileName);
  61. info.AddValue ("FileLoad_FusionLog", fusionLog);
  62. }
  63. }
  64. }