2002-06-08 Martin Baulig <martin@gnome.org>
[mono.git] / mcs / class / corlib / System / NotFiniteNumberException.cs
index f460a356033b9b587d8ab5114154f9233fad6ab5..dd3cc054b48d2311a3820162068ab81fd9fccbc5 100644 (file)
@@ -3,18 +3,22 @@
 //
 // 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 NotFiniteNumberException : ArithmeticException {
                double offending_number;
 
                // Constructors
                public NotFiniteNumberException ()
-                       : base ("The number encountered was not a finite quantity")
+                       : base (Locale.GetText ("The number encountered was not a finite quantity"))
                {
                }
 
@@ -39,11 +43,25 @@ namespace System {
                        this.offending_number = offending_number;
                }
 
+               protected NotFiniteNumberException (SerializationInfo info, StreamingContext context)
+                       : base (info, context)
+               {
+                       offending_number = info.GetDouble ("OffendingNumber");
+               }               
+
                // Properties
-               public virtual double OffendingNumber {
+               public double OffendingNumber {
                        get {
                                return offending_number;
                        }
                }
+
+               // Method
+
+               public override void GetObjectData (SerializationInfo info, StreamingContext context)
+               {
+                       base.GetObjectData (info, context);
+                       info.AddValue ("OffendingNumber", offending_number);
+               }
        }
-}
\ No newline at end of file
+}