+2002-01-31 Duncan Mak <duncan@ximian.com>
+
+ * FileLoadException.cs:
+ * FileNotFoundException: Added missing bits for serialization.
Thu Jan 24 17:42:54 CET 2002 Paolo Molaro <lupus@ximian.com>
//
// Author:
// Paolo Molaro (lupus@ximian.com)
+// Duncan Mak (duncan@ximian.com)
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
//
-namespace System.IO {
+using System.Globalization;
+using System.Runtime.Serialization;
+namespace System.IO {
+ [Serializable]
public class FileLoadException : SystemException {
+
+ // Fields
+ string msg;
+ Exception inner;
+ string fileName;
+ string fusionLog;
+
// Constructors
public FileLoadException ()
- : base ("I/O Error")
+ : base (Locale.GetText ("I/O Error"))
{
+ msg = Locale.GetText ("I/O Error");
}
public FileLoadException (string message)
: base (message)
{
+ msg = message;
}
public FileLoadException (string message, Exception inner)
: base (message, inner)
{
+ msg = message;
+ this.inner = inner;
+ }
+
+ protected FileLoadException (SerializationInfo info, StreamingContext context)
+ {
+ fileName = info.GetString ("FileLoad_FileName");
+ fusionLog = info.GetString ("FileLoad_FusionLog");
}
- [MonoTODO]
- public string FusionLog {
- get {
- // FIXME
- return null;
- }
+ // Properties
+ public override string Message
+ {
+ get { return msg; }
+ }
+
+ public string FileName
+ {
+ get { return fileName; }
+ }
+
+ public string FusionLog
+ {
+ get { return fusionLog; }
+ }
+
+ // Methods
+ public override void GetObjectData (SerializationInfo info, StreamingContext context)
+ {
+ base.GetObjectData (info, context);
+ info.AddValue ("FileLoad_FileName", fileName);
+ info.AddValue ("FileLoad_FusionLog", fusionLog);
}
+
}
}
//
// Author:
// Paolo Molaro (lupus@ximian.com)
+// Duncan Mak (duncan@ximian.com)
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
//
+using System.Globalization;
+using System.Runtime.Serialization;
namespace System.IO {
public class FileNotFoundException : SystemException {
- private string _fileName;
+ private string fileName;
+ private string fusionLog;
+ private string msg;
+ private Exception inner;
// Constructors
public FileNotFoundException ()
- : base ("File not found")
+ : base (Locale.GetText ("File not found"))
{
+ msg = "File not found";
}
public FileNotFoundException (string message)
: base (message)
{
+ msg = message;
}
public FileNotFoundException (string message, Exception inner)
: base (message, inner)
{
+ msg = message;
+ this.inner = inner;
}
public FileNotFoundException (string message, string fileName)
: base (message)
{
- _fileName = fileName;
+ msg = message;
+ this.fileName = fileName;
}
- public string FileName {
- get {
- return _fileName;
- }
+ public FileNotFoundException (string message, string fileName, Exception innerException)
+ : base (message, innerException)
+ {
+ msg = message;
+ this.fileName = fileName;
+ inner = innerException;
}
- [MonoTODO]
- public string FusionLog {
- get {
- // FIXME
- return null;
- }
+ protected FileNotFoundException (SerializationInfo info, StreamingContext context)
+ : base (info, context)
+ {
+ fileName = info.GetString ("FileNotFound_FileName");
+ fusionLog = info.GetString ("FileNotFound_FusionLog");
+
+ }
+
+ public string FileName
+ {
+ get { return fileName; }
+ }
+
+ public string FusionLog
+ {
+ get { return fusionLog; }
+ }
+
+ public override string Message
+ {
+ get { return Locale.GetText (msg); }
+ }
+
+ public override void GetObjectData (SerializationInfo info, StreamingContext context)
+ {
+ info.AddValue ("FileNotFound_FileName", fileName);
+ info.AddValue ("FileNotFound_FusionLog", fusionLog);
+ }
+
+ public override string ToString ()
+ {
+ return inner.ToString();
}
}
}
namespace System
{
- [Serializable]
- public class AppDomainUnloadedException : SystemException
- {
- // Constructors
- public AppDomainUnloadedException ()
- : base (Locale.GetText ("Can't access an unloaded application domain."))
- {
- }
+ [Serializable]
+ public class AppDomainUnloadedException : SystemException
+ {
+ // Constructors
+ public AppDomainUnloadedException ()
+ : base (Locale.GetText ("Can't access an unloaded application domain."))
+ {
+ }
- public AppDomainUnloadedException (string message)
- : base (message)
- {
- }
+ public AppDomainUnloadedException (string message)
+ : base (message)
+ {
+ }
- protected AppDomainUnloadedException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
+ protected AppDomainUnloadedException (SerializationInfo info,
+ StreamingContext context)
+ : base (info, context)
+ {
+ }
- public AppDomainUnloadedException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
-
- }
+ public AppDomainUnloadedException (string message, Exception innerException)
+ :base (message, innerException)
+ {
+ }
+
+ }
}
namespace System
{
- [Serializable]
+ [Serializable]
public class ApplicationException : Exception
{
// Constructors
//
// Author:
// Joe Shaw (joe@ximian.com)
+// Duncan Mak (duncan@ximian.com)
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
//
using System.Globalization;
+using System.Runtime.Serialization;
namespace System {
this.actual_value = actual_value;
}
+ public ArgumentOutOfRangeException (SerializationInfo info, StreamingContext context)
+ : base (info, context)
+ {
+ actual_value = info.GetString ("ActualValue");
+ }
+
// Properties
public virtual object ActualValue {
get {
return actual_value;
}
}
+
+ // Methods
+ public override void GetObjectData (SerializationInfo info, StreamingContext context)
+ {
+ base.GetObjectData (info, context);
+ info.AddValue ("ActualValue", actual_value);
+ }
+
}
}
//
// Author:
// Joe Shaw (joe@ximian.com)
+// Duncan Mak (duncan@ximian.com)
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
//
using System.Globalization;
+using System.Runtime.Serialization;
namespace System {
-
+ [Serializable]
public class ArithmeticException : SystemException {
// Constructors
public ArithmeticException ()
: base (message, inner)
{
}
+
+ protected ArithmeticException (SerializationInfo info, StreamingContext context)
+ : base (info, context)
+ {
+ }
}
}
// (C) 2001 Ximian, Inc. http://www.ximian.com
//
using System.Globalization;
+using System.Runtime.Serialization;
namespace System {
-
+ [Serializable]
public class ArrayTypeMismatchException : SystemException {
// Constructors
public ArrayTypeMismatchException ()
: base (message, inner)
{
}
+
+ protected ArrayTypeMismatchException (SerializationInfo info, StreamingContext context)
+ : base (info, context)
+ {
+ }
+
+
}
}
// System.BadImageFormatException
//
// Sean MacIsaac (macisaac@ximian.com)
+// Duncan Mak (duncan@ximian.com)
//
// (C) 2001 Ximian, Inc.
using System.Globalization;
+using System.Runtime.Serialization;
+
namespace System
{
- public class BadImageFormatException : Exception
+ [Serializable]
+ public class BadImageFormatException : SystemException
{
- public string FusionLog {
- get {
- throw new NotImplementedException ();
- }
+ // Fields
+ private string msg; // we need this because System.Exception's message is private.
+ private Exception inner;
+ private string fileName;
+ private string fusionLog;
+
+ // Constructors
+ public BadImageFormatException ()
+ : base (Locale.GetText ("Invalid file image."))
+ {
+ msg = "Invalid file image.";
+ }
+
+ public BadImageFormatException (string message)
+ : base (message)
+ {
+ msg = message;
+ }
+
+ protected BadImageFormatException (SerializationInfo info, StreamingContext context)
+ : base (info, context)
+ {
+ fileName = info.GetString ("BadImageFormat_FileName");
+ fusionLog = info.GetString ("BadImageFormat_FusionLog");
+ }
+
+ public BadImageFormatException (string message, Exception inner)
+ : base (message, inner)
+ {
+ msg = message;
+ this.inner = inner;
+ }
+
+ public BadImageFormatException (string message, string fileName)
+ : base (message)
+ {
+ msg = message;
+ this.fileName = fileName;
+ }
+
+ public BadImageFormatException (string message, string fileName, Exception inner)
+ : base (message, inner)
+ {
+ msg = message;
+ this.inner = inner;
+ this.fileName = fileName;
+ }
+
+ // Properties
+ public override string Message
+ {
+ get { return Locale.GetText (msg); }
+ }
+
+ public string FileName
+ {
+ get { return fileName; }
+ }
+
+ public string FusionLog
+ {
+ get { return fusionLog; }
+ }
+
+ // Methods
+ public override void GetObjectData (SerializationInfo info, StreamingContext context)
+ {
+ base.GetObjectData (info, context);
+ info.AddValue ("BadImageFormat_FileName", fileName);
+ info.AddValue ("BadImageFormat_FusionLog", fusionLog);
+ }
+
+ public override string ToString ()
+ {
+ return inner.ToString();
}
}
}
+2002-01-31 Duncan Mak <duncan@ximian.com>
+
+ * AppDomainUnloadedException.cs:
+ * ApplicationException.cs:
+ * ArgumentOutOfRangeException.cs:
+ * ArithmeticException.cs:
+ * ArrayTypeMismatchException:
+ * BadImageFormatException.cs:
+ * Exception.cs:
+ * MissingMemberException.cs:
+ * TypeLoadException.cs: Added missing bits for serialization.
+
2002-01-30 Duco Fijma <duco@lorentz.xs4all.nl>
* Guid.cs: implemented everything but Guid.NewGuid
{
info.AddValue ("ClassName", class_name);
info.AddValue ("Message", message);
- info.AddValue ("InnerException", inner_exception);
+ info.AddValue ("InnerException", inner_exception);
info.AddValue ("HelpURL", help_link);
info.AddValue ("StackTraceString", stack_trace);
info.AddValue ("RemoteStackTrace", remote_stack_trace);
+//
+// System.MissingMemberException.cs
+//
+// Author: Duncan Mak (duncan@ximian.com)
+//
+// (C) Ximian, Inc. http://www.ximian.com
+//
using System;
using System.Globalization;
using System.Runtime.Serialization;
[Serializable]
public class MissingMemberException : MemberAccessException {
- // Fields
+ // Fields
protected string ClassName;
protected string MemberName;
protected byte[] Signature;
-
+ private string msg;
// Constructors
public MissingMemberException ()
: base (Locale.GetText ("A missing member exception has occurred."))
{
+ msg = Locale.GetText ("A missing member exception has occured.");
}
public MissingMemberException (string message)
: base (message)
{
+ msg = message;
}
protected MissingMemberException (SerializationInfo info, StreamingContext context)
- : base (info, context) {
+ : base (info, context)
+ {
+ ClassName = info.GetString ("MMClassName");
+ MemberName = info.GetString ("MMMemberName");
+ Signature = (byte[]) info.GetValue ("MMSignature", Signature.GetType ());
}
public MissingMemberException (string message, Exception inner)
: base (message, inner)
{
+ msg = message;
}
- [MonoTODO]
public MissingMemberException (string className, string memberName)
{
+ ClassName = className;
+ MemberName = memberName;
}
- // Properties
- [MonoTODO]
+ // Properties
public override string Message
{
- get { return null; }
+ get { return msg; }
}
// Methods
- [MonoTODO]
- public override void GetObjectData (SerializationInfo info,
- StreamingContext context)
+ public override void GetObjectData (SerializationInfo info, StreamingContext context)
{
+ base.GetObjectData (info, context);
+ info.AddValue ("MMClassName", ClassName);
+ info.AddValue ("MMMemberName", MemberName);
+ info.AddValue ("MMSignature", Signature);
+
}
}
public TypeLoadException ()
: base (Locale.GetText ("A type load exception has occurred."))
{
+ msg = Locale.GetText ("A type load exception has occured.");
}
public TypeLoadException (string message)
: base (message)
{
+ msg = message;
}
public TypeLoadException (string message, Exception inner)
: base (message, inner)
{
+ msg = message;
}
public TypeLoadException (SerializationInfo info,
{
}
- // Methods
- [MonoTODO]
- public override void GetObjectData (SerializationInfo info,
- StreamingContext context)
- {
- }
-
// Properties
- [MonoTODO]
public override string Message
{
- get { return null; }
+ get { return msg; }
}
- [MonoTODO]
public string TypeName
{
- get { return null; }
+ get { return type; }
+ }
+
+ // Method
+ [MonoTODO] // it seems like this object serializes more fields than those described.
+ public override void GetObjectData (SerializationInfo info, StreamingContext context)
+ {
+ if (info == null)
+ throw new ArgumentNullException ("info is null.");
+ base.GetObjectData (info, context);
}
}
}