2004-03-08 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
authorAndreas N <andreas@mono-cvs.ximian.com>
Mon, 8 Mar 2004 21:34:44 +0000 (21:34 -0000)
committerAndreas N <andreas@mono-cvs.ximian.com>
Mon, 8 Mar 2004 21:34:44 +0000 (21:34 -0000)
* SystemException.cs: Exceptions set the HResult
* TypeLoadException.cs: Exceptions set the HResult, fixed wrong exception usage
* SByte.cs: Implemented two missing methods, fix wrong parameters for ArgumentNullException

svn path=/trunk/mcs/; revision=23816

mcs/class/corlib/System/ChangeLog
mcs/class/corlib/System/SByte.cs
mcs/class/corlib/System/SystemException.cs
mcs/class/corlib/System/TypeLoadException.cs

index f02cba9e4d3c94269b76cba7cf2ea104fa4f1d94..ffc343c9df57c76261a8f5d3ae4fe45aff93d0ef 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-08  Andreas Nahr <ClassDevelopment@A-SoftTech.com>
+
+       * SystemException.cs: Exceptions set the HResult
+       * TypeLoadException.cs: Exceptions set the HResult, fixed wrong exception usage
+       * SByte.cs: Implemented two missing methods, fix wrong parameters for ArgumentNullException
+
 2004-03-08  Andreas Nahr <ClassDevelopment@A-SoftTech.com>
 
        * TypedReference.cs
index 29b5a65fc40e103a3e4384be9037acede3c0cc39..f7c88b9791b8ba4f9582dda2ce9e392973684e6c 100644 (file)
@@ -60,7 +60,7 @@ namespace System
                        bool digits_seen = false;
 
                        if (s == null)
-                               throw new ArgumentNullException (Locale.GetText ("s is null"));
+                               throw new ArgumentNullException ("s");
 
                        len = s.Length;
 
@@ -77,12 +77,12 @@ namespace System
                        c = s [i];
                        if (c == '+')
                                i++;
-                       else if (c == '-'){
+                       else if (c == '-') {
                                neg = true;
                                i++;
                        }
 
-                       for (; i < len; i++){
+                       for (; i < len; i++) {
                                c = s [i];
 
                                if (c >= '0' && c <= '9') {
@@ -179,7 +179,7 @@ namespace System
 
                DateTime IConvertible.ToDateTime (IFormatProvider provider)
                {
-                       throw new NotImplementedException ();
+                       return System.Convert.ToDateTime (value);
                }
 
                decimal IConvertible.ToDecimal (IFormatProvider provider)
@@ -220,7 +220,7 @@ namespace System
 
                object IConvertible.ToType (Type conversionType, IFormatProvider provider)
                {
-                       throw new NotImplementedException ();
+                       return System.Convert.ToType (value, conversionType, provider);
                }
 
                [CLSCompliant (false)]
index 405cd9cf8eac81e2047775a1552fba151eb624d0..d4b8d3309726660c024f555b9142b909c4201f36 100644 (file)
@@ -14,18 +14,22 @@ namespace System
        [Serializable]
        public class SystemException : Exception
        {
+               const int Result = unchecked ((int)0x80131501);
+
                // Constructors
                public SystemException ()
                        : base (Locale.GetText ("A system exception has occurred."))
                {
+                       HResult = Result;
                }
 
                public SystemException (string message)
                        : base (message)
                {
+                       HResult = Result;
                }
 
-               protected SystemException(SerializationInfo info, StreamingContext context)
+               protected SystemException (SerializationInfo info, StreamingContext context)
                        : base (info, context)
                {
                }
@@ -33,6 +37,7 @@ namespace System
                public SystemException (string message, Exception inner)
                        : base (message, inner)
                {
+                       HResult = Result;
                }
        }
 }
index 8b3883043f2452edbbfeaaf658504abb14b97620..6f17f0626b37388b433d8b5d663cee946a768796 100644 (file)
@@ -1,46 +1,50 @@
 //
 // System.TypeLoadException.cs
 //
-// Author:
+// Authors:
 //   Sean MacIsaac (macisaac@ximian.com)
 //   Duncan Mak  (duncan@ximian.com)
 //
 // (C) 2001 Ximian, Inc.  http://www.ximian.com
 //
 
-using System.Globalization;
 using System.Runtime.Serialization;
 
-namespace System {
-
+namespace System
+{
        [Serializable]
-       public class TypeLoadException : SystemException {
-
+       public class TypeLoadException : SystemException
+       {
+               const int Result = unchecked ((int)0x80131522);
+               
                // Fields
                private string msg;
                private string type;
 
-                // Constructors
+               // Constructors
                public TypeLoadException ()
                        : base (Locale.GetText ("A type load exception has occurred."))
                {
+                       HResult = Result;
                }
 
                public TypeLoadException (string message)
                        : base (message)
                {
+                       HResult = Result;
                }
 
                public TypeLoadException (string message, Exception inner)
                        : base (message, inner)
                {
+                       HResult = Result;
                }
 
                protected TypeLoadException (SerializationInfo info, StreamingContext context)
                        : base (info, context)
                {
                        if (info == null)
-                               throw new ArgumentNullException ("info is null.");
+                               throw new ArgumentNullException ("info");
 
                        type = info.GetString ("TypeLoadClassName");
                }
@@ -71,7 +75,7 @@ namespace System {
                public override void GetObjectData (SerializationInfo info, StreamingContext context)
                {
                        if (info == null)
-                               throw new ArgumentNullException ("info is null.");
+                               throw new ArgumentNullException ("info");
 
                        base.GetObjectData (info, context);
                        info.AddValue ("TypeLoadClassName", type, typeof (string));