2001-07-06 Joe Shaw <joe@ximian.com>
authorJoe Shaw <joe@joeshaw.org>
Fri, 6 Jul 2001 22:58:09 +0000 (22:58 -0000)
committerJoe Shaw <joe@joeshaw.org>
Fri, 6 Jul 2001 22:58:09 +0000 (22:58 -0000)
* Int16.cs, Int32.cs, Int64.cs, UInt16.cs, UInt32.cs, UInt64.cs:
Implement the IComparable and IFormattable interfaces. Fix a
typo (publig -> public)

* ApplicationException.cs, ArgumentException.cs,
ArgumentNullException.cs, ArgumentOutOfRangeException.cs,
ArtithmeticException.cs, ArrayTypeMismatchException.cs,
DivideByZeroException.cs, DuplicateWaitObjectException.cs,
ExecutionEngineException.cs, FormatException.cs,
IndexOutOfRangeException.cs, InvalidCastException.cs,
InvalidOperationException.cs, InvalidProgramException.cs,
MulticateNotSupportedException.cs, NotFiniteNumberException.cs,
NotSupportedException.cs, NullReferenceException.cs,
OutOfMemoryException.cs, OverflowException.cs, RankException.cs,
StackOverflowException.cs, SystemException.cs,
TypeInitializationException.cs: Added all of the exceptions
specified by the language spec. Mmmm... bloat.

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

31 files changed:
mcs/class/corlib/System/ApplicationException.cs [new file with mode: 0644]
mcs/class/corlib/System/ArgumentException.cs [new file with mode: 0644]
mcs/class/corlib/System/ArgumentNullException.cs [new file with mode: 0644]
mcs/class/corlib/System/ArgumentOutOfRangeException.cs [new file with mode: 0644]
mcs/class/corlib/System/ArithmeticException.cs [new file with mode: 0644]
mcs/class/corlib/System/ArrayTypeMismatchException.cs [new file with mode: 0644]
mcs/class/corlib/System/ChangeLog
mcs/class/corlib/System/DivideByZeroException.cs [new file with mode: 0644]
mcs/class/corlib/System/DuplicateWaitObjectException.cs [new file with mode: 0644]
mcs/class/corlib/System/ExecutionEngineException.cs [new file with mode: 0644]
mcs/class/corlib/System/FormatException.cs [new file with mode: 0644]
mcs/class/corlib/System/IndexOutOfRangeException.cs [new file with mode: 0644]
mcs/class/corlib/System/Int16.cs
mcs/class/corlib/System/Int32.cs
mcs/class/corlib/System/Int64.cs
mcs/class/corlib/System/InvalidCastException.cs [new file with mode: 0644]
mcs/class/corlib/System/InvalidOperationException.cs [new file with mode: 0644]
mcs/class/corlib/System/InvalidProgramException.cs [new file with mode: 0644]
mcs/class/corlib/System/MulticastNotSupportedException.cs [new file with mode: 0644]
mcs/class/corlib/System/NotFiniteNumberException.cs [new file with mode: 0644]
mcs/class/corlib/System/NotSupportedException.cs [new file with mode: 0644]
mcs/class/corlib/System/NullReferenceException.cs [new file with mode: 0644]
mcs/class/corlib/System/OutOfMemoryException.cs [new file with mode: 0644]
mcs/class/corlib/System/OverflowException.cs [new file with mode: 0644]
mcs/class/corlib/System/RankException.cs [new file with mode: 0644]
mcs/class/corlib/System/StackOverflowException.cs [new file with mode: 0644]
mcs/class/corlib/System/SystemException.cs [new file with mode: 0644]
mcs/class/corlib/System/TypeInitializationException.cs [new file with mode: 0644]
mcs/class/corlib/System/UInt16.cs
mcs/class/corlib/System/UInt32.cs
mcs/class/corlib/System/UInt64.cs

diff --git a/mcs/class/corlib/System/ApplicationException.cs b/mcs/class/corlib/System/ApplicationException.cs
new file mode 100644 (file)
index 0000000..0e19c3e
--- /dev/null
@@ -0,0 +1,29 @@
+//
+// System.ApplicationException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public class ApplicationException : Exception {
+               // Constructors
+               public ApplicationException ()
+                       : base ("An application exception has occurred.");
+               {
+               }
+
+               public ApplicationException (string message)
+                       : base (message)
+               {
+               }
+
+               public ApplicationException (string message, Exception inner)
+                       : base (message, inner)
+               {
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System/ArgumentException.cs b/mcs/class/corlib/System/ArgumentException.cs
new file mode 100644 (file)
index 0000000..c97c57c
--- /dev/null
@@ -0,0 +1,50 @@
+//
+// System.ArgumentException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public class ArgumentException : SystemException {
+               private string param_name;
+
+               // Constructors
+               public ArgumentException ()
+                       : base ("An invalid argument was specified.")
+               {
+               }
+
+               public ArgumentException (string message)
+                       : base (message)
+               {
+               }
+
+               public ArgumentException (string message, Exception inner)
+                       : base (message, inner)
+               {
+               }
+
+               public ArgumentException (string message, string param_name)
+                       : base (message)
+               {
+                       this.param_name = param_name;
+               }
+
+               public ArgumentException (string message, string param_name, Exception inner)
+                       : base (message, inner)
+               {
+                       this.param_name = param_name;
+               }
+
+               // Properties           
+               public virtual string ParamName {
+                       get {
+                               return param_name;
+                       }
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System/ArgumentNullException.cs b/mcs/class/corlib/System/ArgumentNullException.cs
new file mode 100644 (file)
index 0000000..d35a964
--- /dev/null
@@ -0,0 +1,29 @@
+//
+// System.ArgumentNullException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public class ArgumentNullException : ArgumentException {
+               // Constructors
+               public ArgumentNullException ()
+                       : base ("Argument cannot be null")
+               {
+               }
+
+               public ArgumentNullException (string param_name)
+                       : base ("Argument cannot be null", param_name)
+               {
+               }
+
+               public ArgumentNullException (string param_name, string message)
+                       : base (message, param_name)
+               {
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System/ArgumentOutOfRangeException.cs b/mcs/class/corlib/System/ArgumentOutOfRangeException.cs
new file mode 100644 (file)
index 0000000..26acf91
--- /dev/null
@@ -0,0 +1,44 @@
+//
+// System.ArgumentOutOfRangeException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public class ArgumentOutOfRangeException : ArgumentException {
+               private object actual_value;
+
+               // Constructors
+               public ArgumentOutOfRangeException ()
+                       : base ("Argument is out of range")
+               {
+               }
+
+               public ArgumentOutOfRangeException (string param_name)
+                       : base ("Argument is out of range", param_name)
+               {
+               }
+
+               public ArgumentOutOfRangeException (string param_name, string message)
+                       : base (message, param_name)
+               {
+               }
+
+               public ArgumentOutOfRangeException (string param_name, object actual_value, string message)
+                       : base (message, param_name)
+               {
+                       this.actual_value = actual_value;
+               }
+
+               // Properties
+               public virtual object ActualValue {
+                       get {
+                               return actual_value;
+                       }
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System/ArithmeticException.cs b/mcs/class/corlib/System/ArithmeticException.cs
new file mode 100644 (file)
index 0000000..cc5bfa9
--- /dev/null
@@ -0,0 +1,29 @@
+//
+// System.ArithmeticException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public class ArithmeticException : SystemException {
+               // Constructors
+               public ArithmeticException ()
+                       : base ("The arithmetic operation is not allowed")
+               {
+               }
+
+               public ArithmeticException (string message)
+                       : base (message)
+               {
+               }
+
+               public ArithmeticException (string message, Exception inner)
+                       : base (message, inner)
+               {
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System/ArrayTypeMismatchException.cs b/mcs/class/corlib/System/ArrayTypeMismatchException.cs
new file mode 100644 (file)
index 0000000..ecfc88a
--- /dev/null
@@ -0,0 +1,29 @@
+//
+// System.ArrayTypeMismatchException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public class ArrayTypeMismatchException : SystemException {
+               // Constructors
+               public ArrayTypeMismatchException ()
+                       : base ("Source array type cannot be assigned to destination array type")
+               {
+               }
+
+               public ArrayTypeMismatchException (string message)
+                       : base (message)
+               {
+               }
+
+               public ArrayTypeMismatchException (string message, Exception inner)
+                       : base (message, inner)
+               {
+               }
+       }
+}
\ No newline at end of file
index 70b49170b9df96905110301f2b081347f82a7ac2..e53b897c07360aa60da1196d243c3722a86e90c9 100644 (file)
@@ -1,3 +1,23 @@
+2001-07-06  Joe Shaw  <joe@ximian.com>
+
+       * Int16.cs, Int32.cs, Int64.cs, UInt16.cs, UInt32.cs, UInt64.cs:
+       Implement the IComparable and IFormattable interfaces. Fix a
+       typo (publig -> public)
+
+       * ApplicationException.cs, ArgumentException.cs,
+       ArgumentNullException.cs, ArgumentOutOfRangeException.cs,
+       ArtithmeticException.cs, ArrayTypeMismatchException.cs,
+       DivideByZeroException.cs, DuplicateWaitObjectException.cs,
+       ExecutionEngineException.cs, FormatException.cs,
+       IndexOutOfRangeException.cs, InvalidCastException.cs,
+       InvalidOperationException.cs, InvalidProgramException.cs,
+       MulticateNotSupportedException.cs, NotFiniteNumberException.cs,
+       NotSupportedException.cs, NullReferenceException.cs,
+       OutOfMemoryException.cs, OverflowException.cs, RankException.cs,
+       StackOverflowException.cs, SystemException.cs,
+       TypeInitializationException.cs: Added all of the exceptions
+       specified by the language spec. Mmmm... bloat.
+
 2001-07-06  Miguel de Icaza  <miguel@ximian.com>
 
        * Int64.cs, Int32.cs: Put.  Parsing and ToString missing.  Should
diff --git a/mcs/class/corlib/System/DivideByZeroException.cs b/mcs/class/corlib/System/DivideByZeroException.cs
new file mode 100644 (file)
index 0000000..5b94f58
--- /dev/null
@@ -0,0 +1,29 @@
+//
+// System.DivideByZeroException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public class DivideByZeroException : ArithmeticException {
+               // Constructors
+               public DivideByZeroException ()
+                       : base ("Division by zero")
+               {
+               }
+
+               public DivideByZeroException (string message)
+                       : base (message)
+               {
+               }
+
+               public DivideByZeroException (string message, Exception inner)
+                       : base (message, inner)
+               {
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System/DuplicateWaitObjectException.cs b/mcs/class/corlib/System/DuplicateWaitObjectException.cs
new file mode 100644 (file)
index 0000000..72ccc25
--- /dev/null
@@ -0,0 +1,29 @@
+//
+// System.DuplicateWaitObjectException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public class DuplicateWaitObjectException : ArgumentException {
+               // Constructors
+               public DuplicateWaitObjectException ()
+                       : base ("Duplicate objects in argument")
+               {
+               }
+
+               public DuplicateWaitObjectException (string param_name)
+                       : base ("Duplicate objects in argument", param_name)
+               {
+               }
+
+               public DuplicateWaitObjectException (string param_name, string message)
+                       : base (message, param_name)
+               {
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System/ExecutionEngineException.cs b/mcs/class/corlib/System/ExecutionEngineException.cs
new file mode 100644 (file)
index 0000000..db1e2b5
--- /dev/null
@@ -0,0 +1,29 @@
+//
+// System.ExecutionEngineException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public sealed class ExecutionEngineException : SystemException {
+               // Constructors
+               public ExecutionEngineException ()
+                       : base ("Internal error occurred") // Haha. Nice.
+               {
+               }
+
+               public ExecutionEngineException (string message)
+                       : base (message)
+               {
+               }
+
+               public ExecutionEngineException (string message, Exception inner)
+                       : base (message, inner)
+               {
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System/FormatException.cs b/mcs/class/corlib/System/FormatException.cs
new file mode 100644 (file)
index 0000000..332d50e
--- /dev/null
@@ -0,0 +1,29 @@
+//
+// System.FormatException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public class FormatException : SystemException {
+               // Constructors
+               public FormatException ()
+                       : base ("Invalid format")
+               {
+               }
+
+               public FormatException (string message)
+                       : base (message)
+               {
+               }
+
+               public FormatException (string message, Exception inner)
+                       : base (message, inner)
+               {
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System/IndexOutOfRangeException.cs b/mcs/class/corlib/System/IndexOutOfRangeException.cs
new file mode 100644 (file)
index 0000000..62a690b
--- /dev/null
@@ -0,0 +1,29 @@
+//
+// System.IndexOutOfRangeException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public sealed class IndexOutOfRangeException : SystemException {
+               // Constructors
+               public IndexOutOfRangeException ()
+                       : base ("Array index is out of range")
+               {
+               }
+
+               public IndexOutOfRangeException (string message)
+                       : base (message)
+               {
+               }
+
+               public IndexOutOfRangeException (string message, Exception inner)
+                       : base (message, inner)
+               {
+               }
+       }
+}
\ No newline at end of file
index 6aefff83f6c0697b5774e02211d1d1d3c65ebb19..00bb2e40c58b4a75a11a0e03773a7c40cf62064c 100644 (file)
@@ -9,7 +9,7 @@
 
 namespace System {
        
-       public struct Int16 : ValueType {
+       public struct Int16 : ValueType, IComparable, IFormattable {
                public const short MinValue = -32768;
                public const short MaxValue =  32767;
                
@@ -84,7 +84,7 @@ namespace System {
                        return "";
                }
 
-               publig string ToString (string format, IFormatProvider fp)
+               public string ToString (string format, IFormatProvider fp)
                {
                        // TODO: Implement me.
                        return "";
index 3ce657a9c0ca153eda3e0b15b751d321d338418e..1df0729468ecf6f01fec4676061a4e5715cdd91c 100644 (file)
@@ -9,7 +9,7 @@
 
 namespace System {
        
-       public struct Int32 : ValueType {
+       public struct Int32 : ValueType, IComparable, IFormattable {
                public const int MinValue = 0x80000000;
                public const int MaxValue = 0x7fffffff;
                
@@ -84,7 +84,7 @@ namespace System {
                        return "";
                }
 
-               publig string ToString (string format, IFormatProvider fp)
+               public string ToString (string format, IFormatProvider fp)
                {
                        // TODO: Implement me.
                        return "";
index 4db940ddf3e7464334a063c7f9a0346b898cc01c..89a2578f820bdc180e42399dacb0f460317e705a 100644 (file)
@@ -9,7 +9,7 @@
 
 namespace System {
        
-       public struct Int64 : ValueType {
+       public struct Int64 : ValueType, IComparable, IFormattable {
                public const long MinValue = 0x8000000000000000;
                public const long MaxValue = 0x7fffffffffffffff;
                
@@ -84,7 +84,7 @@ namespace System {
                        return "";
                }
 
-               publig string ToString (string format, IFormatProvider fp)
+               public string ToString (string format, IFormatProvider fp)
                {
                        // TODO: Implement me.
                        return "";
diff --git a/mcs/class/corlib/System/InvalidCastException.cs b/mcs/class/corlib/System/InvalidCastException.cs
new file mode 100644 (file)
index 0000000..2398979
--- /dev/null
@@ -0,0 +1,29 @@
+//
+// System.InvalidCastException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public class InvalidCastException : SystemException {
+               // Constructors
+               public InvalidCastException ()
+                       : base ("Cannot cast from source type to destination type")
+               {
+               }
+
+               public InvalidCastException (string message)
+                       : base (message)
+               {
+               }
+
+               public InvalidCastException (string message, Exception inner)
+                       : base (message, inner)
+               {
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System/InvalidOperationException.cs b/mcs/class/corlib/System/InvalidOperationException.cs
new file mode 100644 (file)
index 0000000..c57029a
--- /dev/null
@@ -0,0 +1,29 @@
+//
+// System.InvalidOperationException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public class InvalidOperationException : SystemException {
+               // Constructors
+               public InvalidOperationException ()
+                       : base ("The requested operation cannot be performed")
+               {
+               }
+
+               public InvalidOperationException (string message)
+                       : base (message)
+               {
+               }
+
+               public InvalidOperationException (string message, Exception inner)
+                       : base (message, inner)
+               {
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System/InvalidProgramException.cs b/mcs/class/corlib/System/InvalidProgramException.cs
new file mode 100644 (file)
index 0000000..8815055
--- /dev/null
@@ -0,0 +1,29 @@
+//
+// System.InvalidProgramException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public sealed class InvalidProgramException : SystemException {
+               // Constructors
+               public InvalidProgramException ()
+                       : base ("Metadata is incorrect")
+               {
+               }
+
+               public InvalidProgramException (string message)
+                       : base (message)
+               {
+               }
+
+               public InvalidProgramException (string message, Exception inner)
+                       : base (message, inner)
+               {
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System/MulticastNotSupportedException.cs b/mcs/class/corlib/System/MulticastNotSupportedException.cs
new file mode 100644 (file)
index 0000000..02d2a79
--- /dev/null
@@ -0,0 +1,29 @@
+//
+// System.MulticastNotSupportedException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public sealed class MulticastNotSupportedException : SystemException {
+               // Constructors
+               public MulticastNotSupportedException ()
+                       : base ("This operation cannot be performed with the specified delagates")
+               {
+               }
+
+               public MulticastNotSupportedException (string message)
+                       : base (message)
+               {
+               }
+
+               public MulticastNotSupportedException (string message, Exception inner)
+                       : base (message, inner)
+               {
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System/NotFiniteNumberException.cs b/mcs/class/corlib/System/NotFiniteNumberException.cs
new file mode 100644 (file)
index 0000000..f460a35
--- /dev/null
@@ -0,0 +1,49 @@
+//
+// System.NotFiniteNumberException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public class NotFiniteNumberException : ArithmeticException {
+               double offending_number;
+
+               // Constructors
+               public NotFiniteNumberException ()
+                       : base ("The number encountered was not a finite quantity")
+               {
+               }
+
+               public NotFiniteNumberException (double offending_number)
+               {
+                       this.offending_number = offending_number;
+               }
+
+               public NotFiniteNumberException (string message)
+                       : base (message)
+               {
+               }
+
+               public NotFiniteNumberException (string message, double offending_number)
+               {
+                       this.offending_number = offending_number;
+               }
+
+               public NotFiniteNumberException (string message, double offending_number, Exception inner)
+                       : base (message, inner)
+               {
+                       this.offending_number = offending_number;
+               }
+
+               // Properties
+               public virtual double OffendingNumber {
+                       get {
+                               return offending_number;
+                       }
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System/NotSupportedException.cs b/mcs/class/corlib/System/NotSupportedException.cs
new file mode 100644 (file)
index 0000000..8a6078a
--- /dev/null
@@ -0,0 +1,29 @@
+//
+// System.NotSupportedException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public class NotSupportedException : SystemException {
+               // Constructors
+               public NotSupportedException ()
+                       : base ("Operation is not supported")
+               {
+               }
+
+               public NotSupportedException (string message)
+                       : base (message)
+               {
+               }
+
+               public NotSupportedException (string message, Exception inner)
+                       : base (message, inner)
+               {
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System/NullReferenceException.cs b/mcs/class/corlib/System/NullReferenceException.cs
new file mode 100644 (file)
index 0000000..5f712bb
--- /dev/null
@@ -0,0 +1,29 @@
+//
+// System.NullReferenceException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public class NullReferenceException : SystemException {
+               // Constructors
+               public NullReferenceException ()
+                       : base ("A null value was found where an object instance was required")
+               {
+               }
+
+               public NullReferenceException (string message)
+                       : base (message)
+               {
+               }
+
+               public NullReferenceException (string message, Exception inner)
+                       : base (message, inner)
+               {
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System/OutOfMemoryException.cs b/mcs/class/corlib/System/OutOfMemoryException.cs
new file mode 100644 (file)
index 0000000..597f681
--- /dev/null
@@ -0,0 +1,29 @@
+//
+// System.OutOfMemoryException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public class OutOfMemoryException : SystemException {
+               // Constructors
+               public OutOfMemoryException ()
+                       : base ("There is insufficient memory to continue execution")
+               {
+               }
+
+               public OutOfMemoryException (string message)
+                       : base (message)
+               {
+               }
+
+               public OutOfMemoryException (string message, Exception inner)
+                       : base (message, inner)
+               {
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System/OverflowException.cs b/mcs/class/corlib/System/OverflowException.cs
new file mode 100644 (file)
index 0000000..5bee3b4
--- /dev/null
@@ -0,0 +1,29 @@
+//
+// System.OverflowExceptionException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public class OverflowExceptionException : ArithmeticException {
+               // Constructors
+               public OverflowExceptionException ()
+                       : base ("Number overflow")
+               {
+               }
+
+               public OverflowExceptionException (string message)
+                       : base (message)
+               {
+               }
+
+               public OverflowExceptionException (string message, Exception inner)
+                       : base (message, inner)
+               {
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System/RankException.cs b/mcs/class/corlib/System/RankException.cs
new file mode 100644 (file)
index 0000000..5eb3709
--- /dev/null
@@ -0,0 +1,29 @@
+//
+// System.RankException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public class RankException : SystemException {
+               // Constructors
+               public RankException ()
+                       : base ("Two arrays must have the same number of dimensions")
+               {
+               }
+
+               public RankException (string message)
+                       : base (message)
+               {
+               }
+
+               public RankException (string message, Exception inner)
+                       : base (message, inner)
+               {
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System/StackOverflowException.cs b/mcs/class/corlib/System/StackOverflowException.cs
new file mode 100644 (file)
index 0000000..f389346
--- /dev/null
@@ -0,0 +1,29 @@
+//
+// System.StackOverflowException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public class StackOverflowException : SystemException {
+               // Constructors
+               public StackOverflowException ()
+                       : base ("The requested operation caused a stack overflow")
+               {
+               }
+
+               public StackOverflowException (string message)
+                       : base (message)
+               {
+               }
+
+               public StackOverflowException (string message, Exception inner)
+                       : base (message, inner)
+               {
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System/SystemException.cs b/mcs/class/corlib/System/SystemException.cs
new file mode 100644 (file)
index 0000000..ab16739
--- /dev/null
@@ -0,0 +1,29 @@
+//
+// System.SystemException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public class SystemException : Exception {
+               // Constructors
+               public SystemException ()
+                       : base ("A system exception has occurred.");
+               {
+               }
+
+               public SystemException (string message)
+                       : base (message)
+               {
+               }
+
+               public SystemException (string message, Exception inner)
+                       : base (message, inner)
+               {
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System/TypeInitializationException.cs b/mcs/class/corlib/System/TypeInitializationException.cs
new file mode 100644 (file)
index 0000000..2adbb2f
--- /dev/null
@@ -0,0 +1,30 @@
+//
+// System.TypeInitializationException.cs
+//
+// Author:
+//   Joe Shaw (joe@ximian.com)
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System {
+
+       public class TypeInitializationException : SystemException {
+               string type_name;
+
+               // Constructors
+               public TypeInitializationException (string type_name, Exception inner)
+                       : base ("An exception was thrown by the type initializer for " + type_name, inner)
+               {
+                       this.type_name = type_name;
+               }
+
+               // Properties
+               public string TypeName {
+                       get {
+                               return type_name;
+                       }
+               }
+       }
+
+}
\ No newline at end of file
index a7a17fce08d0049ceedf07ad13630cd0c4483566..a4a29fce9764557b76d2525433510cd2cce41323 100644 (file)
@@ -9,16 +9,16 @@
 
 namespace System {
        
-       public struct UInt16 : ValueType {
+       public struct UInt16 : ValueType, IComparable, IFormattable {
                public const ushort MinValue = 0;
                public const ushort MaxValue = 0xffff;
                
-               short value;
+               ushort value;
 
                public int CompareTo (object v)
                {
                        if (!(value is System.UInt16))
-                               throw new ArgumentException ("Value is not a System.Int16");
+                               throw new ArgumentException ("Value is not a System.UInt16");
 
                        return value - ((ushort) v);
                }
@@ -84,7 +84,7 @@ namespace System {
                        return "";
                }
 
-               publig string ToString (string format, IFormatProvider fp)
+               public string ToString (string format, IFormatProvider fp)
                {
                        // TODO: Implement me.
                        return "";
index 3e8fb7fa1a5b88d005d8737fa5720d352883a3a8..a9bf51a329c31493299aa582c828e42e46805715 100644 (file)
@@ -9,7 +9,7 @@
 
 namespace System {
        
-       public struct Int32 : ValueType {
+       public struct Int32 : ValueType, IComparable, IFormattable {
                public const uint MinValue = 0;
                public const uint MaxValue = 0xffffffff;
                
@@ -84,7 +84,7 @@ namespace System {
                        return "";
                }
 
-               publig string ToString (string format, IFormatProvider fp)
+               public string ToString (string format, IFormatProvider fp)
                {
                        // TODO: Implement me.
                        return "";
index c302ea4e875eb1835b21f02ff42e5b3b3efe65f3..5757149ea3fc668a97bb156382746dcd6f7cafe7 100644 (file)
@@ -9,7 +9,7 @@
 
 namespace System {
        
-       public struct UInt64 : ValueType {
+       public struct UInt64 : ValueType, IComparable, IFormattable {
                public const ulong MinValue = 0;
                public const ulong MaxValue = 0xffffffffffffffff;
                
@@ -84,7 +84,7 @@ namespace System {
                        return "";
                }
 
-               publig string ToString (string format, IFormatProvider fp)
+               public string ToString (string format, IFormatProvider fp)
                {
                        // TODO: Implement me.
                        return "";