2 // System.IO.FileNotFoundException.cs
5 // Paolo Molaro (lupus@ximian.com)
6 // Duncan Mak (duncan@ximian.com)
8 // (C) 2001 Ximian, Inc. http://www.ximian.com
10 using System.Globalization;
12 using System.Runtime.Serialization;
17 public class FileNotFoundException : IOException {
18 private string fileName;
19 private string fusionLog;
21 private Exception inner;
24 public FileNotFoundException ()
25 : base (Locale.GetText ("File not found"))
27 msg = "File not found";
30 public FileNotFoundException (string message)
36 public FileNotFoundException (string message, Exception inner)
37 : base (message, inner)
43 public FileNotFoundException (string message, string fileName)
47 this.fileName = fileName;
50 public FileNotFoundException (string message, string fileName, Exception innerException)
51 : base (message, innerException)
54 this.fileName = fileName;
55 inner = innerException;
58 protected FileNotFoundException (SerializationInfo info, StreamingContext context)
59 : base (info, context)
61 fileName = info.GetString ("FileNotFound_FileName");
62 fusionLog = info.GetString ("FileNotFound_FusionLog");
66 public string FileName
68 get { return fileName; }
71 public string FusionLog
73 get { return fusionLog; }
76 public override string Message
78 get { return Locale.GetText (msg); }
81 public override void GetObjectData (SerializationInfo info, StreamingContext context)
83 info.AddValue ("FileNotFound_FileName", fileName);
84 info.AddValue ("FileNotFound_FusionLog", fusionLog);
87 public override string ToString ()
89 return "System.IO.FileNotFoundException: " + msg;