2004-03-13 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
authorAndreas N <andreas@mono-cvs.ximian.com>
Sat, 13 Mar 2004 23:57:20 +0000 (23:57 -0000)
committerAndreas N <andreas@mono-cvs.ximian.com>
Sat, 13 Mar 2004 23:57:20 +0000 (23:57 -0000)
* Enum.cs
* EntryPointNotFoundException.cs
* DuplicateWaitObjectException.cs
* DoubleFormatter.cs
* DllNotFoundException.cs
* DivideByZeroException.cs
* DelegateSerializationHolder.cs
* Delegate.cs
* DBNull.cs
* ContextStaticAttribute.cs
* ContextMarshalException.cs
* ContextBoundObject.cs
* CLSCompliantAttribute.cs
* CharEnumerator.cs
* CannotUnloadAppDomainException.cs
* BadImageFormatException.cs
* AttributeUsageAttribute.cs
* AttributeTargets.cs
* AsyncCallback.cs
* AssemblyLoadEventHandler.cs
* AssemblyLoadEventArgs.cs
* ArrayTypeMismatchException.cs
* ArithmeticException.cs
* ArgumentOutOfRangeException.cs
* ArgumentNullException.cs
* ArgumentException.cs
* ArgIterator.cs
* ApplicationException.cs
* AppDomainUnloadedException.cs
* AppDomain.cs: Mono styled, fixed exceptions/ locales
  removed excess usings

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

31 files changed:
mcs/class/corlib/System/AppDomainUnloadedException.cs
mcs/class/corlib/System/ApplicationException.cs
mcs/class/corlib/System/ArgIterator.cs
mcs/class/corlib/System/ArgumentException.cs
mcs/class/corlib/System/ArgumentNullException.cs
mcs/class/corlib/System/ArgumentOutOfRangeException.cs
mcs/class/corlib/System/ArithmeticException.cs
mcs/class/corlib/System/ArrayTypeMismatchException.cs
mcs/class/corlib/System/AssemblyLoadEventArgs.cs
mcs/class/corlib/System/AssemblyLoadEventHandler.cs
mcs/class/corlib/System/AsyncCallback.cs
mcs/class/corlib/System/AttributeTargets.cs
mcs/class/corlib/System/AttributeUsageAttribute.cs
mcs/class/corlib/System/BadImageFormatException.cs
mcs/class/corlib/System/CLSCompliantAttribute.cs
mcs/class/corlib/System/CannotUnloadAppDomainException.cs
mcs/class/corlib/System/ChangeLog
mcs/class/corlib/System/CharEnumerator.cs
mcs/class/corlib/System/ContextBoundObject.cs
mcs/class/corlib/System/ContextMarshalException.cs
mcs/class/corlib/System/ContextStaticAttribute.cs
mcs/class/corlib/System/DBNull.cs
mcs/class/corlib/System/Delegate.cs
mcs/class/corlib/System/DelegateSerializationHolder.cs
mcs/class/corlib/System/DivideByZeroException.cs
mcs/class/corlib/System/DllNotFoundException.cs
mcs/class/corlib/System/DoubleFormatter.cs
mcs/class/corlib/System/DuplicateWaitObjectException.cs
mcs/class/corlib/System/EntryPointNotFoundException.cs
mcs/class/corlib/System/Enum.cs
mcs/class/corlib/System/_AppDomain.cs

index 9ca65e65c9cd67145bf7a72be292973cc4ebff2f..8107c6a3ceab2c3325a187f2c8897fc1eab42e15 100644 (file)
@@ -1,14 +1,12 @@
-//     
+//
 // System.AppDomainUnloadedException.cs
 //
 // Author:
-//     Duncan Mak (duncan@ximian.com)
+//   Duncan Mak (duncan@ximian.com)
 //
 // 2002 (C) Ximian, Inc. http://www.ximian.com
 //
 
-using System;
-using System.Globalization;
 using System.Runtime.Serialization;
 
 namespace System
@@ -16,27 +14,25 @@ namespace System
        [Serializable]
        public class AppDomainUnloadedException : SystemException
        {
-                // Constructors
-                public AppDomainUnloadedException ()
-                           : base (Locale.GetText ("Can't access an unloaded application domain."))
-                {
-                }
+               // 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)
-                {
-                }
+               public AppDomainUnloadedException (string message, Exception innerException)
+                       :base (message, innerException)
+               {
+               }
 
-                public AppDomainUnloadedException (string message, Exception innerException)
-                           :base (message, innerException)
-                {
-                }
-                           
+               protected AppDomainUnloadedException (SerializationInfo info, StreamingContext context)
+                       : base (info, context)
+               {
+               }
        }
 }
index 9420c119430dda20e68f86fee0cb6d141f0fd9c5..0475f3ed2008e873dd995c61947c6d26d4628d32 100644 (file)
@@ -9,12 +9,10 @@
 //
 
 using System.Reflection;
-using System.Globalization;
 using System.Runtime.Serialization;
 
 namespace System
 {
-
        [Serializable]
        public class ApplicationException : Exception
        {
@@ -29,8 +27,8 @@ namespace System
                {
                }
 
-               public ApplicationException (string message, Exception inner)
-                       : base (message, inner)
+               public ApplicationException (string message, Exception innerException)
+                       : base (message, innerException)
                {
                }
 
index 21fb39464e596bf93aca8785eb38e7f3c6084327..423779ad5c0c2b174f67b0cf892abc14416f7c3a 100755 (executable)
@@ -16,8 +16,8 @@ namespace System
        {
                IntPtr sig;
                IntPtr args;
-               int    next_arg;
-               int    num_args;
+               int next_arg;
+               int num_args;
 
                [MethodImpl (MethodImplOptions.InternalCall)]
                extern void Setup (IntPtr argsp, IntPtr start);
@@ -46,7 +46,7 @@ namespace System
 
                public override bool Equals (object o)
                {
-                       throw new NotSupportedException("This operation is not supported for this type");
+                       throw new NotSupportedException (Locale.GetText ("ArgIterator does not support Equals."));
                }
 
                public override int GetHashCode ()
@@ -58,7 +58,7 @@ namespace System
                public TypedReference GetNextArg ()
                {
                        if (num_args == next_arg)
-                               throw new InvalidOperationException ("invalid iterator position");
+                               throw new InvalidOperationException (Locale.GetText ("Invalid iterator position."));
                        return IntGetNextArg ();
                }
 
@@ -69,7 +69,7 @@ namespace System
                public TypedReference GetNextArg (RuntimeTypeHandle rth)
                {
                        if (num_args == next_arg)
-                               throw new InvalidOperationException ("invalid iterator position");
+                               throw new InvalidOperationException (Locale.GetText ("Invalid iterator position."));
                        return IntGetNextArg (rth.Value);
                }
 
@@ -79,7 +79,7 @@ namespace System
                public RuntimeTypeHandle GetNextArgType ()
                {
                        if (num_args == next_arg)
-                               throw new InvalidOperationException ("invalid iterator position");
+                               throw new InvalidOperationException (Locale.GetText ("Invalid iterator position."));
                        return new RuntimeTypeHandle (IntGetNextArgType ());
                }
 
index c5b4f26484e2a3a910dd3de0cd2ac47a29a94583..4d787f115da53f9ffd34a189574e235972348ff7 100644 (file)
@@ -6,13 +6,14 @@
 //
 // (C) 2001 Ximian, Inc.  http://www.ximian.com
 //
-using System.Runtime.Serialization;
-using System.Globalization;
 
-namespace System {
+using System.Runtime.Serialization;
 
+namespace System
+{
        [Serializable]
-       public class ArgumentException : SystemException {
+       public class ArgumentException : SystemException
+       {
                private string param_name;
 
                // Constructors
@@ -26,30 +27,30 @@ namespace System {
                {
                }
 
-               public ArgumentException (string message, Exception inner)
-                       : base (message, inner)
+               public ArgumentException (string message, Exception innerException)
+                       : base (message, innerException)
                {
                }
 
-               public ArgumentException (string message, string param_name)
+               public ArgumentException (string message, string paramName)
                        : base (message)
                {
-                       this.param_name = param_name;
+                       this.param_name = paramName;
                }
 
-               public ArgumentException (string message, string param_name, Exception inner)
-                       : base (message, inner)
+               public ArgumentException (string message, string paramName, Exception innerException)
+                       : base (message, innerException)
                {
-                       this.param_name = param_name;
+                       this.param_name = paramName;
                }
 
-               protected ArgumentException (SerializationInfo info, StreamingContext sc)
-                       : base (info, sc)
+               protected ArgumentException (SerializationInfo info, StreamingContext context)
+                       : base (info, context)
                {
                        param_name = info.GetString ("ParamName");
                }
 
-               // Properties           
+               // Properties
                public virtual string ParamName {
                        get {
                                return param_name;
@@ -65,10 +66,10 @@ namespace System {
                                if (param_name == null)
                                        return base_message;
                                else
-                                       return base_message + "\nParameter name: " + param_name;
+                                       return base_message + Environment.NewLine + Locale.GetText ("Parameter name: ") + param_name;
                        }
                }
-               
+
                public override void GetObjectData (SerializationInfo info, StreamingContext context)
                {
                        base.GetObjectData (info, context);
index 40450067332a10d362dbd672dc75e4952e9d784a..3e95ffed398facff8ed5c13b7a5db47f75b12a27 100644 (file)
@@ -8,30 +8,30 @@
 //
 
 using System.Runtime.Serialization;
-using System.Globalization;
-
-namespace System {
 
+namespace System
+{
        [Serializable]
-       public class ArgumentNullException : ArgumentException {
+       public class ArgumentNullException : ArgumentException
+       {
                // Constructors
                public ArgumentNullException ()
-                       : base (Locale.GetText ("Argument cannot be null"))
+                       : base (Locale.GetText ("Argument cannot be null."))
                {
                }
 
-               public ArgumentNullException (string param_name)
-                       : base (Locale.GetText ("Argument cannot be null"), param_name)
+               public ArgumentNullException (string paramName)
+                       : base (Locale.GetText ("Argument cannot be null."), paramName)
                {
                }
 
-               public ArgumentNullException (string param_name, string message)
-                       : base (message, param_name)
+               public ArgumentNullException (string paramName, string message)
+                       : base (message, paramName)
                {
                }
 
-               protected ArgumentNullException (SerializationInfo info, StreamingContext sc)
-                       : base (info, sc)
+               protected ArgumentNullException (SerializationInfo info, StreamingContext context)
+                       : base (info, context)
                {
                }
        }
index e1253bb5ad14181da2396ed6b30968509f45e403..6d6214206f1c6ac72dc576f034b55feb84c43ee2 100644 (file)
@@ -1,42 +1,42 @@
 //
 // System.ArgumentOutOfRangeException.cs
 //
-// Author:
+// Authors:
 //   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 {
-
+namespace System
+{
        [Serializable]
-       public class ArgumentOutOfRangeException : ArgumentException {
+       public class ArgumentOutOfRangeException : ArgumentException
+       {
                private object actual_value;
 
                // Constructors
                public ArgumentOutOfRangeException ()
-                       : base (Locale.GetText ("Argument is out of range"))
+                       : base (Locale.GetText ("Argument is out of range."))
                {
                }
 
-               public ArgumentOutOfRangeException (string param_name)
-                       : base (Locale.GetText ("Argument is out of range"), param_name)
+               public ArgumentOutOfRangeException (string paramName)
+                       : base (Locale.GetText ("Argument is out of range."), paramName)
                {
                }
 
-               public ArgumentOutOfRangeException (string param_name, string message)
-                       : base (message, param_name)
+               public ArgumentOutOfRangeException (string paramName, string message)
+                       : base (message, paramName)
                {
                }
 
-               public ArgumentOutOfRangeException (string param_name, object actual_value, string message)
-                       : base (message, param_name)
+               public ArgumentOutOfRangeException (string paramName, object actualValue, string message)
+                       : base (message, paramName)
                {
-                       this.actual_value = actual_value;
+                       this.actual_value = actualValue;
                }
 
                protected ArgumentOutOfRangeException (SerializationInfo info, StreamingContext context)
index ff6c98cbb35b82c04b3bcb699732feead786172e..63c99412373171af03f3228f79c1422d8c55cc0f 100644 (file)
@@ -8,15 +8,16 @@
 // (C) 2001 Ximian, Inc.  http://www.ximian.com
 //
 
-using System.Globalization;
 using System.Runtime.Serialization;
 
-namespace System {
+namespace System
+{
        [Serializable]
-       public class ArithmeticException : SystemException {
+       public class ArithmeticException : SystemException
+       {
                // Constructors
                public ArithmeticException ()
-                       : base (Locale.GetText ("The arithmetic operation is not allowed"))
+                       : base (Locale.GetText ("The arithmetic operation is not allowed."))
                {
                }
 
@@ -25,8 +26,8 @@ namespace System {
                {
                }
 
-               public ArithmeticException (string message, Exception inner)
-                       : base (message, inner)
+               public ArithmeticException (string message, Exception innerException)
+                       : base (message, innerException)
                {
                }
 
index 2938300de6158935dc3bda257f44c5cd29d3019d..0f5843f441ee901cb2670e0fb91f435038ac8e38 100644 (file)
@@ -6,15 +6,17 @@
 //
 // (C) 2001 Ximian, Inc.  http://www.ximian.com
 //
-using System.Globalization;
+
 using System.Runtime.Serialization;
 
-namespace System {
+namespace System
+{
        [Serializable]
-       public class ArrayTypeMismatchException : SystemException {
+       public class ArrayTypeMismatchException : SystemException
+       {
                // Constructors
                public ArrayTypeMismatchException ()
-                       : base (Locale.GetText ("Source array type cannot be assigned to destination array type"))
+                       : base (Locale.GetText ("Source array type cannot be assigned to destination array type."))
                {
                }
 
@@ -23,8 +25,8 @@ namespace System {
                {
                }
 
-               public ArrayTypeMismatchException (string message, Exception inner)
-                       : base (message, inner)
+               public ArrayTypeMismatchException (string message, Exception innerException)
+                       : base (message, innerException)
                {
                }
 
@@ -32,7 +34,5 @@ namespace System {
                        : base (info, context)
                {
                }
-
-               
        }
 }
index dec3463c6aab087add2afa33de89eed22ff1a3e3..4b32d0f7786e6afd4a86f40a2f2d37718cc63f66 100755 (executable)
@@ -1,5 +1,5 @@
 //
-// System.AssemblyLoadEventArgs.cs 
+// System.AssemblyLoadEventArgs.cs
 //
 // Author:
 //   Chris Hynes (chrish@assistedsolutions.com)
@@ -7,7 +7,6 @@
 // (C) 2001 Chris Hynes
 //
 
-using System;
 using System.Reflection;
 
 namespace System 
@@ -16,19 +15,15 @@ namespace System
        {
                private Assembly m_loadedAssembly;
 
-               public AssemblyLoadEventArgs(Assembly loadedAssembly)
+               public AssemblyLoadEventArgs (Assembly loadedAssembly)
                {
                        this.m_loadedAssembly = loadedAssembly;
                }
 
-               public Assembly LoadedAssembly
-               {
-                       get 
-                       {
+               public Assembly LoadedAssembly {
+                       get {
                                return m_loadedAssembly;
                        }
                }
        }
 }
-
-
index 46074f9523dd1f7b261600d3f6b01dd4a59cf11b..52de63f846004e73f4839cab1c63c9a63205d68c 100755 (executable)
@@ -1,8 +1,10 @@
+//
 // System.AssemblyLoadEventHandler.cs
 //
 // Paolo Molaro
 //
 // (C) 2002 Ximian, Inc.
+//
 
 namespace System
 {
index ba9ead8e6f2b04b32e0b962c55fbcec36ab67429..62a6e0845333421ffe728707d15934fec3a4e804 100644 (file)
@@ -1,5 +1,5 @@
 //
-// System/AsyncCallback.cs
+// System.AsyncCallback.cs
 //
 // Author:
 //   Paolo Molaro (lupus@ximian.com)
@@ -7,7 +7,7 @@
 // (C) Ximian, Inc.  http://www.ximian.com
 //
 
-namespace System {
+namespace System
+{
        public delegate void AsyncCallback (IAsyncResult ar);
 }
-
index 72505159938ee5ec181ff9c5fe9c3f5b00ba6256..a536e26fb77b7021c6b4a063ed904bfaa1fa45cd 100644 (file)
@@ -1,4 +1,5 @@
-// AttributeTargets.cs
+//
+// System.AttributeTargets.cs
 //
 // This code was automatically generated from
 // ECMA CLI XML Library Specification.
@@ -8,75 +9,29 @@
 // URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
 //
 // (C) 2001 Ximian, Inc.  http://www.ximian.com
+//
 
-
-namespace System {
-
-
-       /// <summary>
-       /// </summary>
+namespace System
+{
        [Flags]
-       public enum AttributeTargets {
-
-               /// <summary>
-               /// </summary>
+       public enum AttributeTargets
+       {
                Assembly = 0x00000001,
-
-               /// <summary>
-               /// </summary>
                Module = 0x00000002,
-
-               /// <summary>
-               /// </summary>
                Class = 0x00000004,
-
-               /// <summary>
-               /// </summary>
                Struct = 0x00000008,
-
-               /// <summary>
-               /// </summary>
                Enum = 0x00000010,
-
-               /// <summary>
-               /// </summary>
                Constructor = 0x00000020,
-
-               /// <summary>
-               /// </summary>
                Method = 0x00000040,
-
-               /// <summary>
-               /// </summary>
                Property = 0x00000080,
-
-               /// <summary>
-               /// </summary>
                Field = 0x00000100,
-
-               /// <summary>
-               /// </summary>
                Event = 0x00000200,
-
-               /// <summary>
-               /// </summary>
                Interface = 0x00000400,
-
-               /// <summary>
-               /// </summary>
                Parameter = 0x00000800,
-
-               /// <summary>
-               /// </summary>
                Delegate = 0x00001000,
-
-               /// <summary>
-               /// </summary>
                ReturnValue = 0x00002000,
+               All = Assembly | Module | Class | Struct | Enum | Constructor |
+                       Method | Property | Field | Event | Interface | Parameter | Delegate | ReturnValue
+       }
+}
 
-               /// <summary>
-               /// </summary>
-               All = Assembly | Module | Class | Struct | Enum | Constructor | Method | Property | Field | Event | Interface | Parameter | Delegate | ReturnValue,
-       } // AttributeTargets
-
-} // System
index c0bcb0616a28b3fa70950a3da2a4859b60be42e8..d97b432463f057427cf3b892d2a96913960dfb40 100644 (file)
@@ -1,50 +1,50 @@
-//\r
-// System.AttributeUsage.cs\r
-//\r
-// Author:\r
-//   Miguel de Icaza (miguel@ximian.com)\r
-//\r
-// (C) Ximian, Inc.  http://www.ximian.com\r
-//\r
-\r
-namespace System {\r
-\r
-       [AttributeUsage(AttributeTargets.All)]\r
-       [Serializable]\r
-       public sealed class AttributeUsageAttribute : Attribute {\r
-               AttributeTargets valid_on;\r
-               bool allow_multiple, inherited;\r
-               \r
-               public AttributeUsageAttribute (AttributeTargets validOn)\r
-               {\r
-                       valid_on = validOn;\r
-               }\r
-\r
-               public bool AllowMultiple {\r
-                       get {\r
-                               return allow_multiple;\r
-                       }\r
-\r
-                       set {\r
-                               allow_multiple = value;\r
-                       }\r
-               }\r
-\r
-               public bool Inherited {\r
-                       get {\r
-                               return inherited;\r
-                       }\r
-\r
-                       set {\r
-                               inherited = value;\r
-                       }\r
-               }\r
-\r
-               public AttributeTargets ValidOn {\r
-                       get {\r
-                               return valid_on;\r
-                       }\r
-               }\r
-       }\r
-}\r
-\r
+//
+// System.AttributeUsageAttribute.cs
+//
+// Author:
+//   Miguel de Icaza (miguel@ximian.com)
+//
+// (C) Ximian, Inc.  http://www.ximian.com
+//
+
+namespace System
+{
+       [Serializable]
+       [AttributeUsage(AttributeTargets.All)]
+       public sealed class AttributeUsageAttribute : Attribute
+       {
+               AttributeTargets valid_on;
+               bool allow_multiple, inherited;
+
+               public AttributeUsageAttribute (AttributeTargets validOn)
+               {
+                       valid_on = validOn;
+               }
+
+               public bool AllowMultiple {
+                       get {
+                               return allow_multiple;
+                       }
+                       set {
+                               allow_multiple = value;
+                       }
+               }
+
+               public bool Inherited {
+                       get {
+                               return inherited;
+                       }
+                       set {
+                               inherited = value;
+                       }
+               }
+
+               public AttributeTargets ValidOn {
+                       get {
+                               return valid_on;
+                       }
+               }
+       }
+}
+
+
index 0c948f829506e557a22e8f89062aeb421b3aad68..ea7e4b26e998e952c75138a1c1b5c936e4ef6479 100644 (file)
@@ -1,16 +1,19 @@
-// System.BadImageFormatException
 //
-// Sean MacIsaac (macisaac@ximian.com)
-// Duncan Mak (duncan@ximian.com)
+// System.BadImageFormatException.cs
+//
+// Authors:
+//   Sean MacIsaac (macisaac@ximian.com)
+//   Duncan Mak (duncan@ximian.com)
 //
 // (C) 2001 Ximian, Inc.
+//
 
-using System.Globalization;
 using System.Runtime.Serialization;
 
 namespace System
 {
        [Serializable]
+       [MonoTODO ("fix wrong impl.")]
        public class BadImageFormatException : SystemException
        {
                // Fields
@@ -39,11 +42,11 @@ namespace System
                        fusionLog = info.GetString ("BadImageFormat_FusionLog");
                }
 
-               public BadImageFormatException (string message, Exception inner)
-                       : base (message, inner)
+               public BadImageFormatException (string message, Exception innerException)
+                       : base (message, innerException)
                {
                        msg = message;
-                       this.inner = inner;
+                       this.inner = innerException;
                }
 
                public BadImageFormatException (string message, string fileName)
@@ -53,11 +56,11 @@ namespace System
                        this.fileName = fileName;
                }
 
-               public BadImageFormatException (string message, string fileName, Exception inner)
-                       : base (message, inner)
+               public BadImageFormatException (string message, string fileName, Exception innerException)
+                       : base (message, innerException)
                {
                        msg = message;
-                       this.inner = inner;
+                       this.inner = innerException;
                        this.fileName = fileName;
                }
                    
index aae9120a250981102549602d06d618f0b19d75af..b6bdb3aecebfa53e297e541585e0671488043827 100755 (executable)
@@ -7,23 +7,20 @@
 // (C) Ximian, Inc.  http://www.ximian.com
 //
 
-namespace System {
-
+namespace System
+{
        /// <summary>
        ///   Used to indicate if an element of a program is CLS compliant.
        /// </summary>
-       ///
-       /// <remarks>
-       /// </remarks>
-       [AttributeUsage(AttributeTargets.All)]
+       [AttributeUsage (AttributeTargets.All)]
        [Serializable]
-       public sealed class CLSCompliantAttribute : Attribute {
-
+       public sealed class CLSCompliantAttribute : Attribute
+       {
                bool is_compliant;
 
-               public CLSCompliantAttribute (bool is_compliant)
+               public CLSCompliantAttribute (bool isCompliant)
                {
-                       this.is_compliant = is_compliant;
+                       this.is_compliant = isCompliant;
                }
 
                public bool IsCompliant {
index 1cd03735a353f0e9494f394326923d3dbc669bb7..b1a732faadf85637e14018bb595529cbd5a4e711 100644 (file)
@@ -1,14 +1,12 @@
 //     
-// System.CannotUnloadAppDomainException
+// System.CannotUnloadAppDomainException.cs
 //
 // Author:
-//     Duncan Mak (duncan@ximian.com)
+//   Duncan Mak (duncan@ximian.com)
 //
 // 2002 (C) Ximian, Inc. http://www.ximian.com
 //
 
-using System;
-using System.Globalization;
 using System.Runtime.Serialization;
 
 namespace System
@@ -19,23 +17,22 @@ namespace System
                // Constructors
                public CannotUnloadAppDomainException ()
                        : base (Locale.GetText ("Attempt to unload application domain failed."))
-                       {
-                       }
-               
+               {
+               }
+
                public CannotUnloadAppDomainException (string message)
                        : base (message)
-                       {
-                       }
-               
-               protected CannotUnloadAppDomainException (SerializationInfo info,
-                                                         StreamingContext context)
+               {
+               }
+
+               protected CannotUnloadAppDomainException (SerializationInfo info, StreamingContext context)
                        : base (info, context)
-                       {
-                       }
-               
+               {
+               }
+
                public CannotUnloadAppDomainException (string message, Exception innerException)
                        :base (message, innerException)
-                       {
-                       }
+               {
+               }
        }
 }
index f911230ce60f060c7caaf1765cd6f315e9d4917f..9302506f908932dd253bd082aabc7e4acb4c6c33 100644 (file)
@@ -1,3 +1,37 @@
+2004-03-13  Andreas Nahr <ClassDevelopment@A-SoftTech.com>
+
+       * Enum.cs
+       * EntryPointNotFoundException.cs
+       * DuplicateWaitObjectException.cs
+       * DoubleFormatter.cs
+       * DllNotFoundException.cs
+       * DivideByZeroException.cs
+       * DelegateSerializationHolder.cs
+       * Delegate.cs
+       * DBNull.cs
+       * ContextStaticAttribute.cs
+       * ContextMarshalException.cs
+       * ContextBoundObject.cs
+       * CLSCompliantAttribute.cs
+       * CharEnumerator.cs
+       * CannotUnloadAppDomainException.cs
+       * BadImageFormatException.cs
+       * AttributeUsageAttribute.cs
+       * AttributeTargets.cs
+       * AsyncCallback.cs
+       * AssemblyLoadEventHandler.cs
+       * AssemblyLoadEventArgs.cs
+       * ArrayTypeMismatchException.cs
+       * ArithmeticException.cs
+       * ArgumentOutOfRangeException.cs
+       * ArgumentNullException.cs
+       * ArgumentException.cs
+       * ArgIterator.cs
+       * ApplicationException.cs
+       * AppDomainUnloadedException.cs
+       * AppDomain.cs: Mono styled, fixed exceptions/ locales
+         removed excess usings
+
 2004-03-10  Sebastien Pouliot  <sebastien@ximian.com>
 
        * Convert.cs: FromBase64 now ignore some characters (tab, LF, CR and
index 221d0e56aa5a48b9bd9929b053da92e10570ae73..b9b5f100f17d094b886d29227edfad27287b431e 100644 (file)
@@ -1,7 +1,8 @@
 //
 // System.CharEnumerator.cs
 //
-// Author: Duncan Mak  (duncan@ximian.com)
+// Author:
+//   Duncan Mak (duncan@ximian.com)
 //
 // (C) Ximian, Inc.
 //
@@ -23,30 +24,26 @@ namespace System
                // Constructor
                internal CharEnumerator (string s)
                {
-                        str = s;
-                        index = -1;
-                        length = s.Length;
+                       str = s;
+                       index = -1;
+                       length = s.Length;
                }
-               
-               // Property
-               public char Current
-               {
+
+               // Properties
+               public char Current {
                        get {
                                if (index == -1 || index >= length)
-                                       throw new InvalidOperationException
-                                               ("The position is not valid.");
-
+                                       throw new InvalidOperationException (Locale.GetText ("The position is not valid."));
                                return str [index];
                        }
                }
-               
-               object IEnumerator.Current
-               {
+
+               object IEnumerator.Current {
                        get { 
                                return Current;
                        }
                }
-               
+
                // Methods
                public object Clone ()
                {
@@ -54,7 +51,7 @@ namespace System
                        x.index = index;
                        return x;
                }
-               
+
                public bool MoveNext ()
                {
                        // Representation invariant holds: -1 <= index <= length
@@ -77,7 +74,7 @@ namespace System
                        else
                                return true;
                }
-               
+
                public void Reset ()
                {
                        index = -1;
index 7db6a82708f350623bee84923515892052ca452c..7587b99c6ae0be22e4383250a72b95a61fcba975 100644 (file)
@@ -6,17 +6,12 @@
 //
 // (C) Ximian, Inc.  http://www.ximian.com
 //
-// TODO: Mucho left to implement.
-//
-
-namespace System {
 
-       /// <summary>
-       ///   Base class for all the context-bound classes
-       /// </summary>
+namespace System
+{
        [Serializable]
-       public abstract class ContextBoundObject : MarshalByRefObject {
-
+       public abstract class ContextBoundObject : MarshalByRefObject
+       {
                protected ContextBoundObject ()
                {
                }
index bb058cf2e095dcf4cbb2ebe746c3de013fd6670b..6d9c4745e83ddabd64d316c43b309f001ddabf1a 100644 (file)
@@ -2,13 +2,11 @@
 // System.ContextMarshalException.cs
 //
 // Author:
-//     Duncan Mak (duncan@ximian.com)
+//   Duncan Mak (duncan@ximian.com)
 //
 // 2002 (C) Ximian, Inc. http://www.ximian.com
 //
 
-using System;
-using System.Globalization;
 using System.Runtime.Serialization;
 
 namespace System
@@ -19,24 +17,22 @@ namespace System
                // Constructors
                public ContextMarshalException ()
                        : base (Locale.GetText ("Attempt to marshal and object across a context failed."))
-                       {
-                       }
-               
+               {
+               }
+
                public ContextMarshalException (string message)
                        : base (message)
-                       {
-                       }
+               {
+               }
                
-               protected ContextMarshalException (SerializationInfo info,
-                                                  StreamingContext context)
+               protected ContextMarshalException (SerializationInfo info, StreamingContext context)
                        : base (info, context)
-                       {
-                       }
+               {
+               }
                
                public ContextMarshalException (string message, Exception innerException)
                        :base (message, innerException)
-                       {
-                       }
-               
+               {
+               }
        }
 }
index 054c9845e6f317bb6ec41414fd9e4a64a1f55f68..ddd10614dac526cb3bf2d0a25a1f6159c0c0e8c3 100755 (executable)
@@ -7,22 +7,18 @@
 // (C) Ximian, Inc.  http://www.ximian.com
 //
 
-namespace System {
-
+namespace System
+{
        /// <summary>
        ///   The ContextStatic attribute is used to flag fields as being unique
        /// </summary>
-       ///
-       /// <remarks>
-       ///   
-       /// </remarks>
        [AttributeUsage (AttributeTargets.Field)]
        [Serializable]
-       public class ContextStaticAttribute : Attribute {
-
-                  public ContextStaticAttribute () : base ()
-                  {
-                  }
-               
+       public class ContextStaticAttribute : Attribute
+       {
+               public ContextStaticAttribute ()
+                       : base ()
+               {
+               }
        }
 }
index abc24888f647323b40b219bd6f189c54c3a414f7..586a81fabbce6a3587abcbd23abe13c4a6a11d7b 100644 (file)
@@ -1,9 +1,9 @@
 //
-// DBNull.cs
+// System.DBNull.cs
 //
 // Authors:
-//     Duncan Mak (duncan@ximian.com)
-//     Ben Maurer (bmaurer@users.sourceforge.net)
+//   Duncan Mak (duncan@ximian.com)
+//   Ben Maurer (bmaurer@users.sourceforge.net)
 //
 // (C) 2002 Ximian, Inc. http://www.ximian.com
 // (C) 2003 Ben Maurer
@@ -20,7 +20,14 @@ namespace System
                public static readonly DBNull Value = new DBNull ();
 
                // Private constructor
-               private DBNull () {}
+               private DBNull ()
+               {
+               }
+
+               private DBNull (SerializationInfo info, StreamingContext context)
+               {
+                       throw new NotSupportedException ();
+               }
 
                // Methods
                public void GetObjectData (SerializationInfo info, StreamingContext context)
@@ -91,7 +98,8 @@ namespace System
 
                object IConvertible.ToType (Type type, IFormatProvider provider)
                {
-                       if (type == typeof (string)) return String.Empty;
+                       if (type == typeof (string))
+                               return String.Empty;
                        throw new InvalidCastException ();
                }
 
index 63cd402b794dd1674306fe20b8c1d34248cf2322..2582c860ee480a1465e040d19baaeccf11b60014 100644 (file)
@@ -1,7 +1,7 @@
 //
 // System.Delegate.cs
 //
-// Author:
+// Authors:
 //   Miguel de Icaza (miguel@ximian.com)
 //   Daniel Stodden (stodden@in.tum.de)
 //   Dietmar Maurer (dietmar@ximian.com)
@@ -9,21 +9,19 @@
 // (C) Ximian, Inc.  http://www.ximian.com
 //
 
-using System;
-using System.Globalization;
 using System.Reflection;
 using System.Runtime.Serialization;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 
-
-namespace System {
-
+namespace System
+{
 #if NET_1_1
        [ClassInterface (ClassInterfaceType.AutoDual)]
 #endif
        [MonoTODO]
-       public abstract class Delegate : ICloneable, ISerializable {
+       public abstract class Delegate : ICloneable, ISerializable
+       {
                protected Type target_type;
                protected object m_target;
                protected string method_name;
@@ -34,10 +32,10 @@ namespace System {
                protected Delegate (object target, string method)
                {
                        if (target == null)
-                               throw new ArgumentNullException (Locale.GetText ("Target object is null"));
+                               throw new ArgumentNullException ("target");
 
                        if (method == null)
-                               throw new ArgumentNullException (Locale.GetText ("method name is null"));
+                               throw new ArgumentNullException ("method");
 
                        this.target_type = null;
                        this.method_ptr = IntPtr.Zero;
@@ -45,15 +43,15 @@ namespace System {
                        this.method_name = method;
                }
 
-               protected Delegate (Type target_type, string method)
+               protected Delegate (Type target, string method)
                {
-                       if (target_type == null)
-                               throw new ArgumentNullException (Locale.GetText ("Target type is null"));
+                       if (target == null)
+                               throw new ArgumentNullException ("target");
 
                        if (method == null)
-                               throw new ArgumentNullException (Locale.GetText ("method string is null"));
+                               throw new ArgumentNullException ("method");
 
-                       this.target_type = target_type;
+                       this.target_type = target;
                        this.method_ptr = IntPtr.Zero;
                        this.m_target = null;
                        this.method_name = method;
@@ -75,35 +73,35 @@ namespace System {
                // Methods
                //
 
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
                internal static extern Delegate CreateDelegate_internal (Type type, object target, MethodInfo info);
 
-               public static Delegate CreateDelegate (Type type, MethodInfo info)
+               public static Delegate CreateDelegate (Type type, MethodInfo method)
                {
                        if (type == null)
-                               throw new ArgumentNullException (Locale.GetText ("Type is null"));
+                               throw new ArgumentNullException ("type");
 
-                       if (info == null)
-                               throw new ArgumentNullException (Locale.GetText ("MethodInfo is null"));
+                       if (method == null)
+                               throw new ArgumentNullException ("method");
 
                        if (!type.IsSubclassOf (typeof (MulticastDelegate)))
                                throw new ArgumentException ("type");
 
-                       if (!info.IsStatic)
-                               throw new ArgumentException ("The method should be static.", "info");
+                       if (!method.IsStatic)
+                               throw new ArgumentException ("The method should be static.", "method");
 
                        ParameterInfo[] delargs = type.GetMethod ("Invoke").GetParameters ();
-                       ParameterInfo[] args = info.GetParameters ();
+                       ParameterInfo[] args = method.GetParameters ();
 
                        if (args.Length != delargs.Length)
-                               throw new ArgumentException ("info");
+                               throw new ArgumentException ("method");
                        
                        int length = delargs.Length;
                        for (int i = 0; i < length; i++)
                                if (delargs [i].ParameterType != args [i].ParameterType)
-                                       throw new ArgumentException ("info");
+                                       throw new ArgumentException ("method");
 
-                       return CreateDelegate_internal (type, null, info);
+                       return CreateDelegate_internal (type, null, method);
                }
 
                public static Delegate CreateDelegate (Type type, object target, string method)
@@ -114,16 +112,16 @@ namespace System {
                public static Delegate CreateDelegate (Type type, Type target, string method)
                {
                        if (type == null)
-                               throw new ArgumentNullException (Locale.GetText ("Type is null"));
+                               throw new ArgumentNullException ("type");
 
                        if (target == null)
-                               throw new ArgumentNullException (Locale.GetText ("Target type is null"));
+                               throw new ArgumentNullException ("target");
 
                        if (method == null)
-                               throw new ArgumentNullException (Locale.GetText ("method string is null"));
+                               throw new ArgumentNullException ("method");
 
                        if (!type.IsSubclassOf (typeof (MulticastDelegate)))
-                               throw new ArgumentException ("type is not subclass of MulticastDelegate");
+                               throw new ArgumentException ("type is not subclass of MulticastDelegate.");
 
                        ParameterInfo[] delargs = type.GetMethod ("Invoke").GetParameters ();
                        Type[] delargtypes = new Type [delargs.Length];
@@ -139,21 +137,21 @@ namespace System {
                        MethodInfo info = target.GetMethod (method, flags, null, delargtypes, new ParameterModifier [0]);
 
                        if (info == null)
-                               throw new ArgumentException ("Couldn't bind to method");
+                               throw new ArgumentException ("Couldn't bind to method.");
 
                        return CreateDelegate_internal (type, null, info);
                }
 
-               public static Delegate CreateDelegate (Type type, object target, string method, bool ignorecase)
+               public static Delegate CreateDelegate (Type type, object target, string method, bool ignoreCase)
                {
                        if (type == null)
-                               throw new ArgumentNullException (Locale.GetText ("Type is null"));
+                               throw new ArgumentNullException ("type");
 
                        if (target == null)
-                               throw new ArgumentNullException (Locale.GetText ("Target object is null"));
+                               throw new ArgumentNullException ("target");
 
                        if (method == null)
-                               throw new ArgumentNullException (Locale.GetText ("method string is null"));
+                               throw new ArgumentNullException ("method");
 
                        if (!type.IsSubclassOf (typeof (MulticastDelegate)))
                                throw new ArgumentException ("type");
@@ -170,13 +168,13 @@ namespace System {
                         */
                        BindingFlags flags = BindingFlags.ExactBinding | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance;
 
-                       if (ignorecase)
+                       if (ignoreCase)
                                flags |= BindingFlags.IgnoreCase;
 
                        MethodInfo info = target.GetType ().GetMethod (method, flags, null, delargtypes, new ParameterModifier [0]);
 
                        if (info == null)
-                               throw new ArgumentException ("Couldn't bind to method '" + method + "'");
+                               throw new ArgumentException ("Couldn't bind to method '" + method + "'.");
 
                        return CreateDelegate_internal (type, target, info);
                }
@@ -188,9 +186,9 @@ namespace System {
 
                internal virtual object DynamicInvokeImpl (object[] args)
                {
-                       if (Method == null){
+                       if (Method == null) {
                                Type[] mtypes = new Type [args.Length];
-                               for (int i = 0; i < args.Length; ++i){
+                               for (int i = 0; i < args.Length; ++i) {
                                        mtypes [i] = args [i].GetType ();
                                }
                                method_info = m_target.GetType ().GetMethod (method_name, mtypes);
@@ -203,17 +201,15 @@ namespace System {
                        return MemberwiseClone ();
                }
 
-               public override bool Equals (object o)
+               public override bool Equals (object obj)
                {
-                       if (o == null)
+                       if (obj == null)
                                return false;
-                       
-                       Delegate d = (Delegate) o;
+
+                       Delegate d = (Delegate) obj;
                        // Do not compare method_ptr, since it can point to a trampoline
-                       if ((d.target_type == target_type) &&
-                           (d.m_target == m_target) &&
-                           (d.method_name == method_name) &&
-                               (d.method_info == method_info))
+                       if ((d.target_type == target_type) && (d.m_target == m_target) &&
+                               (d.method_name == method_name) && (d.method_info == method_info))
                                return true;
 
                        return false;
@@ -241,7 +237,7 @@ namespace System {
                /// </symmary>
                public static Delegate Combine (Delegate a, Delegate b)
                {
-                       if (a == null){
+                       if (a == null) {
                                if (b == null)
                                        return null;
                                return b;
@@ -250,7 +246,7 @@ namespace System {
                                        return a;
 
                        if (a.GetType () != b.GetType ())
-                               throw new ArgumentException (Locale.GetText ("Incompatible Delegate Types"));
+                               throw new ArgumentException (Locale.GetText ("Incompatible Delegate Types."));
                        
                        return a.CombineImpl (b);
                }
@@ -259,7 +255,7 @@ namespace System {
                ///   Returns a new MulticastDelegate holding the
                ///   concatenated invocation lists of an Array of MulticastDelegates
                /// </symmary>
-               public static Delegate Combine( Delegate[] delegates )
+               public static Delegate Combine (Delegate[] delegates)
                {
                        Delegate retval = null;
 
@@ -269,18 +265,16 @@ namespace System {
                        return retval;
                }
 
-
                protected virtual Delegate CombineImpl (Delegate d)
                {
                        throw new MulticastNotSupportedException ("");
                }
-               
-               
+
                public static Delegate Remove (Delegate source, Delegate value) 
                {
                        if (source == null)
                                return null;
-                               
+
                        return source.RemoveImpl (value);
                }
 
@@ -288,7 +282,7 @@ namespace System {
                {
                        if (this.Equals (d))
                                return null;
-                      
+
                        return this;
                }
 #if NET_1_1
index 4c74198f5b5563e3e385748a3fac8fc47b6bcabf..40986fc1d00ff447eef104d1d380f3d72905444e 100644 (file)
-// DelegateSerializationHolder.cs
+//
+// System.DelegateSerializationHolder.cs
 //
 // Author:
-//  Lluis Sanchez Gual (lsg@ctv.es)
+//   Lluis Sanchez Gual (lsg@ctv.es)
 //
 // (C) 2003 Lluis Sanchez Gual
+//
 
-using System;\r
-using System.Reflection;\r
+using System.Reflection;
 using System.Runtime.Serialization;
-\r
-namespace System\r
-{\r
-       [Serializable]\r
-       public class DelegateSerializationHolder: ISerializable, IObjectReference\r
-       {\r
-               Delegate _delegate;     // The deserialized delegate\r
-\r
-               [Serializable]\r
-               class DelegateEntry\r
-               {\r
-                       // A DelegateEntry holds information about a delegate that is part\r
-                       // of an invocation list of a multicast delegate.\r
-\r
-                       public DelegateEntry (Delegate del, string targetLabel)\r
-                       {\r
-                               type = del.GetType().FullName;\r
-                               assembly = del.GetType().Assembly.FullName;\r
-                               target = targetLabel;\r
-                               targetTypeAssembly = del.Method.DeclaringType.Assembly.FullName;\r
-                               targetTypeName = del.Method.DeclaringType.FullName;\r
-                               methodName = del.Method.Name;\r
-                       }\r
-\r
-                       public Delegate DeserializeDelegate(SerializationInfo info)\r
-                       {\r
-                               object realTarget = null;\r
-                               if (target != null)\r
-                                       realTarget = info.GetValue (target.ToString(), typeof(object));\r
-\r
-                               Assembly dasm = Assembly.Load (assembly);\r
-                               Type dt = dasm.GetType (type);\r
-\r
-                               Delegate del;\r
-                               if (realTarget != null)\r
-                                       del = Delegate.CreateDelegate (dt, realTarget, methodName);\r
-                               else\r
-                               {\r
-                                       Assembly tasm = Assembly.Load (targetTypeAssembly);\r
-                                       Type tt = tasm.GetType (targetTypeName);\r
-                                       del = Delegate.CreateDelegate (dt, tt, methodName);\r
-                               }\r
-\r
-                               if (!del.Method.IsPublic)\r
-                                       throw new SerializationException ("Serialization will not deserialize delegates to non-public methods.");\r
-\r
-                               return del;\r
-                       }\r
-\r
-                       string type;\r
-                       string assembly;\r
-                       public object target;\r
-                       string targetTypeAssembly;\r
-                       string targetTypeName;\r
-                       string methodName;\r
-                       public DelegateEntry delegateEntry;     // next delegate in the invocation list\r
-               }\r
-\r
-               DelegateSerializationHolder(SerializationInfo info, StreamingContext ctx)\r
-               {\r
-                       DelegateEntry entryChain = (DelegateEntry)info.GetValue ("Delegate", typeof(DelegateEntry));\r
-\r
-                       // Count the number of delegates to combine\r
-\r
-                       int count = 0;\r
-                       DelegateEntry entry = entryChain;\r
-                       while (entry != null)\r
-                       {\r
-                               entry = entry.delegateEntry;\r
-                               count++;\r
-                       }\r
-\r
-                       // Deserializes and combines the delegates\r
-\r
-                       if (count == 1) \r
-                               _delegate = entryChain.DeserializeDelegate (info);\r
-                       else\r
-                       {\r
-                               Delegate[] delegates = new Delegate[count];\r
-                               entry = entryChain;\r
-                               for (int n=0; n<count; n++)\r
-                               {\r
-                                       delegates[n] = entry.DeserializeDelegate (info);\r
-                                       entry = entry.delegateEntry;\r
-                               }\r
-\r
-                               _delegate = Delegate.Combine (delegates);\r
-                       }\r
-               }\r
-\r
-               public static void GetDelegateData(Delegate instance, SerializationInfo info, StreamingContext ctx)\r
-               {\r
-                       // Fills a SerializationInfo object with the information of the delegate.\r
-\r
-                       Delegate[] delegates = instance.GetInvocationList();\r
-                       DelegateEntry lastEntry = null;\r
-                       for (int n=0; n<delegates.Length; n++)\r
-                       {\r
-                               Delegate del = delegates[n];\r
-                               string targetLabel = (del.Target != null) ? ("target" + n) : null;\r
-                               DelegateEntry entry = new DelegateEntry(del, targetLabel);\r
-\r
-                               if (lastEntry == null)\r
-                                       info.AddValue ("Delegate", entry);\r
-                               else\r
-                                       lastEntry.delegateEntry = entry;\r
-\r
-                               lastEntry = entry;\r
-                               if (del.Target != null)\r
-                                       info.AddValue (targetLabel, del.Target);\r
-                       }\r
+
+namespace System
+{
+       [Serializable]
+       public class DelegateSerializationHolder: ISerializable, IObjectReference
+       {
+               Delegate _delegate; // The deserialized delegate
+
+               [Serializable]
+               class DelegateEntry
+               {
+                       string type;
+                       string assembly;
+                       public object target;
+                       string targetTypeAssembly;
+                       string targetTypeName;
+                       string methodName;
+                       public DelegateEntry delegateEntry; // next delegate in the invocation list
+
+                       // A DelegateEntry holds information about a delegate that is part
+                       // of an invocation list of a multicast delegate.
+                       public DelegateEntry (Delegate del, string targetLabel)
+                       {
+                               type = del.GetType().FullName;
+                               assembly = del.GetType().Assembly.FullName;
+                               target = targetLabel;
+                               targetTypeAssembly = del.Method.DeclaringType.Assembly.FullName;
+                               targetTypeName = del.Method.DeclaringType.FullName;
+                               methodName = del.Method.Name;
+                       }
+
+                       public Delegate DeserializeDelegate (SerializationInfo info)
+                       {
+                               object realTarget = null;
+                               if (target != null)
+                                       realTarget = info.GetValue (target.ToString(), typeof(object));
+
+                               Assembly dasm = Assembly.Load (assembly);
+                               Type dt = dasm.GetType (type);
+                               Delegate del;
+                               if (realTarget != null)
+                                       del = Delegate.CreateDelegate (dt, realTarget, methodName);
+                               else {
+                                       Assembly tasm = Assembly.Load (targetTypeAssembly);
+                                       Type tt = tasm.GetType (targetTypeName);
+                                       del = Delegate.CreateDelegate (dt, tt, methodName);
+                               }
+
+                               if (!del.Method.IsPublic)
+                                       throw new SerializationException (Locale.GetText (
+                                               "Serialization will not deserialize delegates to non-public methods."));
+
+                               return del;
+                       }
+               }
+
+               DelegateSerializationHolder(SerializationInfo info, StreamingContext ctx)
+               {
+                       DelegateEntry entryChain = (DelegateEntry)info.GetValue ("Delegate", typeof(DelegateEntry));
+
+                       // Count the number of delegates to combine
+                       int count = 0;
+                       DelegateEntry entry = entryChain;
+                       while (entry != null) {
+                               entry = entry.delegateEntry;
+                               count++;
+                       }
+
+                       // Deserializes and combines the delegates
+                       if (count == 1) 
+                               _delegate = entryChain.DeserializeDelegate (info);
+                       else
+                       {
+                               Delegate[] delegates = new Delegate[count];
+                               entry = entryChain;
+                               for (int n=0; n<count; n++)
+                               {
+                                       delegates[n] = entry.DeserializeDelegate (info);
+                                       entry = entry.delegateEntry;
+                               }
+                               _delegate = Delegate.Combine (delegates);
+                       }
+               }
+
+               public static void GetDelegateData (Delegate instance, SerializationInfo info, StreamingContext ctx)
+               {
+                       // Fills a SerializationInfo object with the information of the delegate.
+
+                       Delegate[] delegates = instance.GetInvocationList ();
+                       DelegateEntry lastEntry = null;
+                       for (int n=0; n<delegates.Length; n++) {
+                               Delegate del = delegates[n];
+                               string targetLabel = (del.Target != null) ? ("target" + n) : null;
+                               DelegateEntry entry = new DelegateEntry (del, targetLabel);
+
+                               if (lastEntry == null)
+                                       info.AddValue ("Delegate", entry);
+                               else
+                                       lastEntry.delegateEntry = entry;
+
+                               lastEntry = entry;
+                               if (del.Target != null)
+                                       info.AddValue (targetLabel, del.Target);
+                       }
                        info.SetType (typeof (DelegateSerializationHolder));
-               }\r
-\r
-               public void GetObjectData(SerializationInfo info, StreamingContext context)\r
-               {\r
-                       // Not needed.\r
-                       throw new NotSupportedException();\r
-               }\r
-\r
-               public object GetRealObject(StreamingContext context)\r
-               {\r
-                       return _delegate;\r
-               }\r
-       }\r
-}\r
+               }
+
+               public void GetObjectData (SerializationInfo info, StreamingContext context)
+               {
+                       // Not needed.
+                       throw new NotSupportedException ();
+               }
+
+               public object GetRealObject (StreamingContext context)
+               {
+                       return _delegate;
+               }
+       }
+}
index 74582bb361dd5966efbca86ed188f2449c474738..e9fce2d7d1cecbb6a891feed97ef71d206a345e3 100644 (file)
@@ -7,13 +7,13 @@
 // (C) 2001 Ximian, Inc.  http://www.ximian.com
 //
 
-using System.Globalization;
 using System.Runtime.Serialization;
 
-namespace System {
-
+namespace System
+{
        [Serializable]
-       public class DivideByZeroException : ArithmeticException {
+       public class DivideByZeroException : ArithmeticException
+       {
                // Constructors
                public DivideByZeroException ()
                        : base (Locale.GetText ("Division by zero"))
@@ -25,8 +25,8 @@ namespace System {
                {
                }
 
-               public DivideByZeroException (string message, Exception inner)
-                       : base (message, inner)
+               public DivideByZeroException (string message, Exception innerException)
+                       : base (message, innerException)
                {
                }
 
index cc332020623357d73b1fbecc197075b3d3fd1df7..2b3574ac0fd3a1b9359805d645334eac0abc3b5b 100644 (file)
@@ -1,14 +1,12 @@
-//     
+//
 // System.DllNotFoundException.cs
 //
 // Author:
-//     Duncan Mak (duncan@ximian.com)
+//   Duncan Mak (duncan@ximian.com)
 //
 // 2002 (C) Ximian, Inc. http://www.ximian.com
 //
 
-using System;
-using System.Globalization;
 using System.Runtime.Serialization;
 
 namespace System
@@ -19,24 +17,22 @@ namespace System
                // Constructors
                public DllNotFoundException ()
                        : base (Locale.GetText ("DLL not found."))
-                       {
-                       }
-               
+               {
+               }
+
                public DllNotFoundException (string message)
                        : base (message)
-                       {
-                       }
-               
-               protected DllNotFoundException (SerializationInfo info,
-                                            StreamingContext context)
+               {
+               }
+
+               protected DllNotFoundException (SerializationInfo info, StreamingContext context)
                        : base (info, context)
-                       {
-                       }
-               
+               {
+               }
+
                public DllNotFoundException (string message, Exception innerException)
                        :base (message, innerException)
-                       {
-                       }
-               
+               {
+               }
        }
 }
index 5437261bedb6a85e405677a299c676d677573ae7..21c2363c8494c7ba049062ebb9c863216920bf95 100644 (file)
@@ -7,37 +7,31 @@
 // Copyright (C) 2003 Pedro Martínez Juliá <yoros@wanadoo.es>
 //
 
-using System;
 using System.Text;
 using System.Collections;
 using System.Globalization;
 
-
-namespace System {
-
-       internal class DoubleFormatter {
-
+namespace System
+{
+       internal class DoubleFormatter
+       {
                private static FloatingPointFormatter fpf;
-               
+
                const double p = 100000000000000.0d;
                const double p10 = 1000000000000000.0;
                const int dec_len = 14;
                const int dec_len_min = -30;
-
                const double p2 = 10000000000000000.0d;
                const double p102 = 100000000000000000.0;
                const int dec_len2 = 16;
                const int dec_len_min2 = -34;
 
-               public static string NumberToString (string format,
-                               NumberFormatInfo nfi, double value) {
+               internal static string NumberToString (string format, NumberFormatInfo nfi, double value)
+               {
                        if (fpf == null) {
-                               fpf = new FloatingPointFormatter (p, p10, dec_len,
-                                       dec_len_min, p2, p102, dec_len2, dec_len_min2);
+                               fpf = new FloatingPointFormatter (p, p10, dec_len, dec_len_min, p2, p102, dec_len2, dec_len_min2);
                        }
                        return fpf.GetStringFrom (format, nfi, value);
                }
-               
        }
-
 }
index beddfd0c5ac0743a7f68acbb32052137c5a4360b..3d6fe3a83a6197f8852826b9f416c4a99b4c5686 100644 (file)
@@ -1,33 +1,33 @@
 //
 // System.DuplicateWaitObjectException.cs
 //
-// Author:
+// Authors:
 //   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 {
-
+namespace System
+{
        [Serializable]
-       public class DuplicateWaitObjectException : ArgumentException {
+       public class DuplicateWaitObjectException : ArgumentException
+       {
                // Constructors
                public DuplicateWaitObjectException ()
-                       : base (Locale.GetText ("Duplicate objects in argument"))
+                       : base (Locale.GetText ("Duplicate objects in argument."))
                {
                }
 
-               public DuplicateWaitObjectException (string param_name)
-                       : base (Locale.GetText ("Duplicate objects in argument"), param_name)
+               public DuplicateWaitObjectException (string parameterName)
+                       : base (Locale.GetText ("Duplicate objects in argument."), parameterName)
                {
                }
 
-               public DuplicateWaitObjectException (string param_name, string message)
-                       : base (message, param_name)
+               public DuplicateWaitObjectException (string parameterName, string message)
+                       : base (message, parameterName)
                {
                }
 
index 672d5261490f01267f3ef4bc918eeaa741780cc5..412704b53c3a47b156527e4d685aac49ff60c894 100644 (file)
@@ -2,13 +2,11 @@
 // System.EntryPointNotFoundException.cs
 //
 // Author:
-//     Duncan Mak (duncan@ximian.com)
+//   Duncan Mak (duncan@ximian.com)
 //
 // 2002 (C) Ximian, Inc. http://www.ximian.com
 //
 
-using System;
-using System.Globalization;
 using System.Runtime.Serialization;
 
 namespace System
@@ -19,24 +17,22 @@ namespace System
                // Constructors
                public EntryPointNotFoundException ()
                        : base (Locale.GetText ("Cannot load class because of missing entry method."))
-                       {
-                       }
-               
+               {
+               }
+
                public EntryPointNotFoundException (string message)
                        : base (message)
-                       {
-                       }
-               
-               protected EntryPointNotFoundException (SerializationInfo info,
-                                                      StreamingContext context)
+               {
+               }
+
+               protected EntryPointNotFoundException (SerializationInfo info, StreamingContext context)
                        : base (info, context)
-                       {
-                       }
-               
+               {
+               }
+
                public EntryPointNotFoundException (string message, Exception innerException)
                        :base (message, innerException)
-                       {
-                       }
-               
+               {
+               }
        }
 }
index 195f3922e979d771143a660d84584897a0f1903b..2348349265711876c3147f54ebc63eb421027f02 100644 (file)
@@ -15,14 +15,16 @@ using System.Collections;
 using System.Globalization;
 using System.Runtime.CompilerServices;
 
-namespace System {
-       internal struct MonoEnumInfo {
+namespace System
+{
+       internal struct MonoEnumInfo
+       {
                internal Type utype;
                internal Array values;
                internal string[] names;
                static Hashtable cache;
                
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
                private static extern void get_enum_info (Type enumType, out MonoEnumInfo info);
                
                private MonoEnumInfo (MonoEnumInfo other)
@@ -31,7 +33,7 @@ namespace System {
                        values = other.values;
                        names = other.names;
                }
-               
+
                internal static void GetInfo (Type enumType, out MonoEnumInfo info)
                {
                        if (cache == null)
@@ -48,15 +50,17 @@ namespace System {
                }
        };
 
+       [MonoTODO ("Locale.GetText")]
        [Serializable]
-       public abstract class Enum : ValueType, IComparable, IConvertible, IFormattable {
-
-               internal Enum () {
+       public abstract class Enum : ValueType, IComparable, IConvertible, IFormattable
+       {
+               internal Enum ()
+               {
                }
-               
-               // IConvertible methods Start -->
 
-               public TypeCode GetTypeCode () {
+               // IConvertible methods Start -->
+               public TypeCode GetTypeCode ()
+               {
                        MonoEnumInfo info;
                        MonoEnumInfo.GetInfo (this.GetType (), out info);
                        return Type.GetTypeCode (info.utype);
@@ -107,7 +111,7 @@ namespace System {
                        return Convert.ToInt64 (get_value (), provider);
                }
 
-               [CLSCompliant(false)]
+               [CLSCompliant (false)]
                sbyte IConvertible.ToSByte (IFormatProvider provider)
                {
                        return Convert.ToSByte (get_value (), provider);
@@ -122,33 +126,33 @@ namespace System {
                {
                        return Convert.ToType (get_value (), conversionType, provider);
                }
-               
-               [CLSCompliant(false)]
+
+               [CLSCompliant (false)]
                ushort IConvertible.ToUInt16 (IFormatProvider provider)
                {
                        return Convert.ToUInt16 (get_value (), provider);
                }
 
-               [CLSCompliant(false)]
+               [CLSCompliant (false)]
                uint IConvertible.ToUInt32 (IFormatProvider provider)
                {
                        return Convert.ToUInt32 (get_value (), provider);
                }
 
-               [CLSCompliant(false)]
+               [CLSCompliant (false)]
                ulong IConvertible.ToUInt64 (IFormatProvider provider)
                {
                        return Convert.ToUInt64 (get_value (), provider);
                }
-
                // <-- End IConvertible methods
 
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
                private extern object get_value ();
-               
-               public static Array GetValues (Type enumType) {
-                       if (null == enumType)
-                               throw new ArgumentNullException ("enumType cannot be null.");
+
+               public static Array GetValues (Type enumType)
+               {
+                       if (enumType == null)
+                               throw new ArgumentNullException ("enumType");
 
                        if (!enumType.IsEnum)
                                throw new ArgumentException ("enumType is not an Enum type.");
@@ -157,10 +161,11 @@ namespace System {
                        MonoEnumInfo.GetInfo (enumType, out info);
                        return (Array) info.values.Clone ();
                }
-               
-               public static string[] GetNames (Type enumType) {
-                       if (null == enumType)
-                               throw new ArgumentNullException ("enumType cannot be null.");
+
+               public static string[] GetNames (Type enumType)
+               {
+                       if (enumType == null)
+                               throw new ArgumentNullException ("enumType");
 
                        if (!enumType.IsEnum)
                                throw new ArgumentException ("enumType is not an Enum type.");
@@ -169,12 +174,13 @@ namespace System {
                        MonoEnumInfo.GetInfo (enumType, out info);
                        return (string []) info.names.Clone ();
                }
-               
-               public static string GetName (Type enumType, object value) {
-                       if (null == enumType)
-                               throw new ArgumentNullException ("enumType cannot be null.");
-                       if (null == value)
-                               throw new ArgumentNullException ("value cannot be null.");
+
+               public static string GetName (Type enumType, object value)
+               {
+                       if (enumType == null)
+                               throw new ArgumentNullException ("enumType");
+                       if (value == null)
+                               throw new ArgumentNullException ("value");
 
                        if (!enumType.IsEnum)
                                throw new ArgumentException ("enumType is not an Enum type.");
@@ -183,18 +189,19 @@ namespace System {
                        int i;
                        value = ToObject (enumType, value);
                        MonoEnumInfo.GetInfo (enumType, out info);
-                       for (i = 0; i < info.values.Length; ++i) {                              
+                       for (i = 0; i < info.values.Length; ++i) {
                                if (value.Equals (info.values.GetValue (i)))
                                        return info.names [i];
                        }
                        return null;
                }
-               
-               public static bool IsDefined (Type enumType, object value) {
-                       if (null == enumType)
-                               throw new ArgumentNullException ("enumType cannot be null.");
-                       if (null == value)
-                               throw new ArgumentNullException ("value cannot be null.");
+
+               public static bool IsDefined (Type enumType, object value)
+               {
+                       if (enumType == null)
+                               throw new ArgumentNullException ("enumType");
+                       if (value == null)
+                               throw new ArgumentNullException ("value");
 
                        if (!enumType.IsEnum)
                                throw new ArgumentException ("enumType is not an Enum type.");
@@ -209,7 +216,7 @@ namespace System {
                                int i;
                                value = ToObject (enumType, value);
                                MonoEnumInfo.GetInfo (enumType, out info);
-                               for (i = 0; i < info.values.Length; ++i) {                              
+                               for (i = 0; i < info.values.Length; ++i) {
                                        if (value.Equals (info.values.GetValue (i)))
                                                return true;
                                }
@@ -219,13 +226,12 @@ namespace System {
                                        + "It must be type String or the same type as the underlying type"
                                        + "of the Enum.");
                        }
-                       
-
                }
-               
-               public static Type GetUnderlyingType (Type enumType) {
-                       if (null == enumType)
-                               throw new ArgumentNullException ("enumType cannot be null.");
+
+               public static Type GetUnderlyingType (Type enumType)
+               {
+                       if (enumType == null)
+                               throw new ArgumentNullException ("enumType");
 
                        if (!enumType.IsEnum)
                                throw new ArgumentException ("enumType is not an Enum type.");
@@ -243,11 +249,11 @@ namespace System {
 
                public static object Parse (Type enumType, string value, bool ignoreCase)
                {
-                       if (null == enumType)
-                               throw new ArgumentNullException ("enumType cannot be null.");
+                       if (enumType == null)
+                               throw new ArgumentNullException ("enumType");
 
-                       if (null == value)
-                               throw new ArgumentNullException ("value cannot be null.");
+                       if (value == null)
+                               throw new ArgumentNullException ("value");
 
                        if (!enumType.IsEnum)
                                throw new ArgumentException ("enumType is not an Enum type.");
@@ -265,16 +271,16 @@ namespace System {
 
                        try {
                                // Attempt to convert to numeric type
-                               return ToObject(enumType, Convert.ChangeType (value, typeCode) );
+                               return ToObject (enumType, Convert.ChangeType (value, typeCode) );
                        } catch {}
 
-                       string[] names = value.Split(new char[] {','});
+                       string[] names = value.Split (new char[] {','});
                        for (i = 0; i < names.Length; ++i)
                                names [i] = names [i].Trim ();
 
                        foreach (string name in names) {
                                bool found = false;
-                               for (i = 0; i < info.values.Length; ++i) {                              
+                               for (i = 0; i < info.values.Length; ++i) {
                                        if (String.Compare (name, info.names [i], ignoreCase, CultureInfo.InvariantCulture) == 0) {
                                                switch (typeCode) {
                                                        case TypeCode.Byte:
@@ -313,10 +319,10 @@ namespace System {
                                        }
                                }
                                if (!found)
-                                       throw new ArgumentException ("The requested value was not found");
+                                       throw new ArgumentException ("The requested value was not found.");
                                
                        }
-                       return ToObject(enumType, retVal);
+                       return ToObject (enumType, retVal);
                }
 
                /// <summary>
@@ -331,24 +337,24 @@ namespace System {
                        if (obj == null)
                                return 1;
 
-                       thisType = this.GetType();
-                       if (obj.GetType() != thisType){
-                               throw new ArgumentException(
+                       thisType = this.GetType ();
+                       if (obj.GetType() != thisType) {
+                               throw new ArgumentException (
                                        "Object must be the same type as the "
                                        + "enum. The type passed in was " 
-                                       + obj.GetType().ToString()
+                                       + obj.GetType().ToString ()
                                        + "; the enum type was " 
-                                       + thisType.ToString() + ".");
+                                       + thisType.ToString () + ".");
                        }
 
                        object value1, value2;
 
                        value1 = this.get_value ();
-                       value2 = ((Enum)obj).get_value();
+                       value2 = ((Enum)obj).get_value ();
 
                        return ((IComparable)value1).CompareTo (value2);
                }
-               
+
                public override string ToString ()
                {
                        return ToString ("G", null);
@@ -368,60 +374,65 @@ namespace System {
                {
                        // provider is not used for Enums
 
-                       if (format == String.Empty || format == null){
+                       if (format == String.Empty || format == null) {
                                format = "G";
                        }
                        return Format (this.GetType(), this.get_value (), format);
                }
 
-               public static object ToObject(Type enumType, byte value)
+               public static object ToObject (Type enumType, byte value)
                {
                        return ToObject (enumType, (object)value);
                }
-               
-               public static object ToObject(Type enumType, short value)
+
+               public static object ToObject (Type enumType, short value)
                {
                        return ToObject (enumType, (object)value);
                }
-               public static object ToObject(Type enumType, int value)
+
+               public static object ToObject (Type enumType, int value)
                {
                        return ToObject (enumType, (object)value);
                }
-               public static object ToObject(Type enumType, long value)
+
+               public static object ToObject (Type enumType, long value)
                {
                        return ToObject (enumType, (object)value);
                }
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               public static extern object ToObject(Type enumType, object value);
+               public static extern object ToObject (Type enumType, object value);
 
-               [CLSCompliant(false)]
-               public static object ToObject(Type enumType, sbyte value)
+               [CLSCompliant (false)]
+               public static object ToObject (Type enumType, sbyte value)
                {
                        return ToObject (enumType, (object)value);
                }
-               [CLSCompliant(false)]
-               public static object ToObject(Type enumType, ushort value)
+
+               [CLSCompliant (false)]
+               public static object ToObject (Type enumType, ushort value)
                {
                        return ToObject (enumType, (object)value);
                }
-               [CLSCompliant(false)]
-               public static object ToObject(Type enumType, uint value)
+
+               [CLSCompliant (false)]
+               public static object ToObject (Type enumType, uint value)
                {
                        return ToObject (enumType, (object)value);
                }
-               [CLSCompliant(false)]
-               public static object ToObject(Type enumType, ulong value)
+
+               [CLSCompliant (false)]
+               public static object ToObject (Type enumType, ulong value)
                {
                        return ToObject (enumType, (object)value);
                }
 
                public override bool Equals (object obj)
                {
-                       if (null == obj || !(obj is Enum))
+                       if (obj == null || !(obj is Enum))
                                return false;
 
-                       if (obj.GetType() != this.GetType())
+                       if (obj.GetType() != this.GetType ())
                                return false;
 
                        object v1 = this.get_value ();
@@ -442,30 +453,30 @@ namespace System {
                        // 8, if it's culture specific, or what.  This works for me.
                        const string format = "x8";
 
-                       switch (Type.GetTypeCode(enumType)) {
+                       switch (Type.GetTypeCode (enumType)) {
                                case TypeCode.Char:
                                        // Char doesn't support ToString(format), so convert to an int and
                                        // use that...
                                        char v = (char) value;
-                                       return Convert.ToInt32(v).ToString(format);
+                                       return Convert.ToInt32 (v).ToString(format);
                                case TypeCode.SByte:
-                                       return ((sbyte)value).ToString(format);
+                                       return ((sbyte)value).ToString (format);
                                case TypeCode.Byte:
-                                       return ((byte)value).ToString(format);
+                                       return ((byte)value).ToString (format);
                                case TypeCode.Int16:
-                                       return ((short)value).ToString(format);
+                                       return ((short)value).ToString (format);
                                case TypeCode.UInt16:
-                                       return ((ushort)value).ToString(format);
+                                       return ((ushort)value).ToString (format);
                                case TypeCode.Int32:
-                                       return ((int)value).ToString(format);
+                                       return ((int)value).ToString (format);
                                case TypeCode.UInt32:
-                                       return ((uint)value).ToString(format);
+                                       return ((uint)value).ToString (format);
                                case TypeCode.Int64:
-                                       return ((long)value).ToString(format);
+                                       return ((long)value).ToString (format);
                                case TypeCode.UInt64:
-                                       return ((ulong)value).ToString(format);
+                                       return ((ulong)value).ToString (format);
                                default:
-                                       throw new Exception ("invalid type code for enumeration");
+                                       throw new Exception ("Invalid type code for enumeration.");
                        }
                }
 
@@ -479,12 +490,11 @@ namespace System {
                                retVal = GetName (enumType, value);
                                if (retVal == null)
                                        retVal = asString;
-
                                return retVal;
                        }
                        // This is ugly, yes.  We need to handle the different integer
                        // types for enums.  If someone else has a better idea, be my guest.
-                       switch (((Enum)info.values.GetValue (0)).GetTypeCode()) {
+                       switch (((Enum)info.values.GetValue (0)).GetTypeCode ()) {
                        case TypeCode.SByte: {
                                sbyte flags = (sbyte) value;
                                sbyte enumValue;
@@ -493,7 +503,7 @@ namespace System {
                                        if (i == 0 && enumValue == 0)
                                                continue;
 
-                                       if ((flags & enumValue) == enumValue){
+                                       if ((flags & enumValue) == enumValue) {
                                                retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
                                                flags -= enumValue;
                                        }
@@ -501,7 +511,7 @@ namespace System {
                                if (flags != 0) return asString;
                                }
                                break;
-                       case TypeCode.Byte:{
+                       case TypeCode.Byte: {
                                byte flags = (byte) value;
                                byte enumValue;
                                for (int i = info.values.Length - 1; i >= 0; i--) {
@@ -509,7 +519,7 @@ namespace System {
                                        if (i == 0 && enumValue == 0)
                                                continue;
 
-                                       if ((flags & enumValue) == enumValue){
+                                       if ((flags & enumValue) == enumValue) {
                                                retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
                                                flags -= enumValue;
                                        }
@@ -525,7 +535,7 @@ namespace System {
                                        if (i == 0 && enumValue == 0)
                                                continue;
 
-                                       if ((flags & enumValue) == enumValue){
+                                       if ((flags & enumValue) == enumValue) {
                                                retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
                                                flags -= enumValue;
                                        }
@@ -541,7 +551,7 @@ namespace System {
                                        if (i == 0 && enumValue == 0)
                                                continue;
 
-                                       if ((flags & enumValue) == enumValue){
+                                       if ((flags & enumValue) == enumValue) {
                                                retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
                                                flags -= enumValue;
                                        }
@@ -557,7 +567,7 @@ namespace System {
                                        if (i == 0 && enumValue == 0)
                                                continue;
 
-                                       if ((flags & enumValue) == enumValue){
+                                       if ((flags & enumValue) == enumValue) {
                                                retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
                                                flags -= enumValue;
                                        }
@@ -573,7 +583,7 @@ namespace System {
                                        if (i == 0 && enumValue == 0)
                                                continue;
 
-                                       if ((flags & enumValue) == enumValue){
+                                       if ((flags & enumValue) == enumValue) {
                                                retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
                                                flags -= enumValue;
                                        }
@@ -589,7 +599,7 @@ namespace System {
                                        if (i == 0 && enumValue == 0)
                                                continue;
 
-                                       if ((flags & enumValue) == enumValue){
+                                       if ((flags & enumValue) == enumValue) {
                                                retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
                                                flags -= enumValue;
                                        }
@@ -605,7 +615,7 @@ namespace System {
                                        if (i == 0 && enumValue == 0)
                                                continue;
 
-                                       if ((flags & enumValue) == enumValue){
+                                       if ((flags & enumValue) == enumValue) {
                                                retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
                                                flags -= enumValue;
                                        }
@@ -623,23 +633,23 @@ namespace System {
 
                public static string Format (Type enumType, object value, string format)
                {
-                       if (null == enumType)
-                               throw new ArgumentNullException("enumType cannot be null");
-                       if (null == value)
-                               throw new ArgumentNullException("value cannot be null");
-                       if (null == format)
-                               throw new ArgumentNullException("format cannot be null");
+                       if (enumType == null)
+                               throw new ArgumentNullException ("enumType");
+                       if (value == null)
+                               throw new ArgumentNullException ("value");
+                       if (format == null)
+                               throw new ArgumentNullException ("format");
 
                        if (!enumType.IsEnum)
-                               throw new ArgumentException("enumType is not an Enum Type");
+                               throw new ArgumentException ("enumType is not an Enum Type.");
                        
                        Type vType = value.GetType();
-                       if (vType != enumType && vType != Enum.GetUnderlyingType(enumType))
-                               throw new ArgumentException();
+                       if (vType != enumType && vType != Enum.GetUnderlyingType (enumType))
+                               throw new ArgumentException ();
 
                        if (format.Length != 1)
                                throw new FormatException ("Format String can be only \"G\",\"g\",\"X\"," + 
-                                                         "\"x\",\"F\",\"f\",\"D\" or \"d\".");
+                                       "\"x\",\"F\",\"f\",\"D\" or \"d\".");
 
                        char formatChar = format [0];
                        string retVal;
@@ -660,12 +670,12 @@ namespace System {
 
                        retVal = "";
                        switch (formatChar) {
-                           case 'X':
-                           case 'x':
+                       case 'X':
+                       case 'x':
                                retVal = FormatSpecifier_X (enumType, value);
                                break;
-                           case 'D':
-                           case 'd':
+                       case 'D':
+                       case 'd':
                                if (Enum.GetUnderlyingType (enumType) == typeof (ulong)) {
                                        ulong ulongValue = Convert.ToUInt64 (value);
                                        retVal = ulongValue.ToString ();
@@ -674,11 +684,10 @@ namespace System {
                                        retVal = longValue.ToString ();
                                }
                                break;
-                           default:
+                       default:
                                throw new FormatException ("Format String can be only \"G\",\"g\",\"X\"," + 
-                                                         "\"x\",\"F\",\"f\",\"D\" or \"d\".");
+                                       "\"x\",\"F\",\"f\",\"D\" or \"d\".");
                        }
-
                        return retVal;
                }
        }
index 4c1c459c4d52bfb207edb709184cf26d8e4786fc..07ead61524215f61bdf04d237f6d525bd776c6a6 100755 (executable)
@@ -1,5 +1,5 @@
 //
-// System._AppDomain
+// System.AppDomain.cs
 //
 // Author:
 //   Duco Fijma (duco@lorentz.xs4all.nl)
@@ -16,149 +16,88 @@ using System.Runtime.InteropServices;
 
 namespace System
 {
+       [CLSCompliant (false)]
+       [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
+       [Guid ("05F696DC-2B29-3663-AD8B-C4389CF2A713")]
+       public interface _AppDomain
+       {
+               string BaseDirectory {get; }
+               string DynamicDirectory {get; }
+               Evidence Evidence {get; }
+               string FriendlyName {get; }
+               string RelativeSearchPath {get; }
+               bool ShadowCopyFiles {get; }
 
-[CLSCompliant(false)]
-[InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
-[Guid ("05F696DC-2B29-3663-AD8B-C4389CF2A713")]
-public interface _AppDomain {
+               void AppendPrivatePath (string path);
+               void ClearPrivatePath ();
+               void ClearShadowCopyPath ();
 
-       string BaseDirectory {get; }
-       string DynamicDirectory {get; }
-       Evidence Evidence {get; }
-       string FriendlyName {get; }
-       string RelativeSearchPath {get; }
-       bool ShadowCopyFiles {get; }
+               ObjectHandle CreateInstance (string assemblyName, string typeName);
+               ObjectHandle CreateInstance (string assemblyName, string typeName, object[] activationAttributes);
+               ObjectHandle CreateInstance (string assemblyName, string typeName, bool ignoreCase,
+                       BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture,
+                       object[] activationAttributes, Evidence securityAttribtutes);
 
-       void AppendPrivatePath (string path);
-       void ClearPrivatePath ();
-       void ClearShadowCopyPath ();
+               ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName);
+               ObjectHandle CreateInstanceFrom (string assemblyName, string typeName, object[] activationAttributes);
+               ObjectHandle CreateInstanceFrom (string assemblyName, string typeName, bool ignoreCase,
+                       BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture,
+                       object[] activationAttributes, Evidence securityAttribtutes);
 
-       ObjectHandle CreateInstance (string assemblyName, string typeName);
-       ObjectHandle CreateInstance (
-               string assemblyName,
-               string typeName,
-               object[] activationAttributes);
-       ObjectHandle CreateInstance (
-               string assemblyName,
-               string typeName,
-               bool ignoreCase,
-               BindingFlags bindingAttr,
-               Binder binder,
-               object[] args,
-               CultureInfo culture,
-               object[] activationAttributes,
-               Evidence securityAttribtutes);
+               AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access);
+               AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, Evidence evidence);
+               AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir);
+               AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir, Evidence evidence);
+               AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
+                       PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPersmissions);
+               AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
+                       Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions,
+                       PermissionSet refusedPersmissions);
+               AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
+                       string dir, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPersmissions);
+               AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
+                       string dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions,
+                       PermissionSet refusedPersmissions);
+               AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir,
+                       Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions,
+                       PermissionSet refusedPersmissions, bool isSynchronized);
 
-       ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName);
-       ObjectHandle CreateInstanceFrom (
-               string assemblyName, string typeName,
-               object[] activationAttributes);
-       ObjectHandle CreateInstanceFrom (string assemblyName,
-               string typeName,
-               bool ignoreCase,
-               BindingFlags bindingAttr,
-               Binder binder,
-               object[] args,
-               CultureInfo culture,
-               object[] activationAttributes,
-               Evidence securityAttribtutes);
+               void DoCallBack (CrossAppDomainDelegate theDelegate);
+               bool Equals (object other);
 
-       AssemblyBuilder DefineDynamicAssembly (
-               AssemblyName name,
-               AssemblyBuilderAccess access);
-       AssemblyBuilder DefineDynamicAssembly (
-               AssemblyName name,
-               AssemblyBuilderAccess access,
-               Evidence evidence);
-       AssemblyBuilder DefineDynamicAssembly (
-               AssemblyName name,
-               AssemblyBuilderAccess access, string dir);
-       AssemblyBuilder DefineDynamicAssembly (
-               AssemblyName name,
-               AssemblyBuilderAccess access,
-               string dir,
-               Evidence evidence);
-       AssemblyBuilder DefineDynamicAssembly (
-               AssemblyName name,
-               AssemblyBuilderAccess access,
-               PermissionSet requiredPermissions,
-               PermissionSet optionalPermissions,
-               PermissionSet refusedPersmissions);
-       AssemblyBuilder DefineDynamicAssembly (
-               AssemblyName name,
-               AssemblyBuilderAccess access,
-               Evidence evidence,
-               PermissionSet requiredPermissions,
-               PermissionSet optionalPermissions,
-               PermissionSet refusedPersmissions);
-       AssemblyBuilder DefineDynamicAssembly (
-               AssemblyName name,
-               AssemblyBuilderAccess access,
-               string dir,
-               PermissionSet requiredPermissions,
-               PermissionSet optionalPermissions,
-               PermissionSet refusedPersmissions);
-       AssemblyBuilder DefineDynamicAssembly (
-               AssemblyName name,
-               AssemblyBuilderAccess access,
-               string dir,
-               Evidence evidence,
-               PermissionSet requiredPermissions,
-               PermissionSet optionalPermissions,
-               PermissionSet refusedPersmissions);
-       AssemblyBuilder DefineDynamicAssembly (
-               AssemblyName name,
-               AssemblyBuilderAccess access,
-               string dir,
-               Evidence evidence,
-               PermissionSet requiredPermissions,
-               PermissionSet optionalPermissions,
-               PermissionSet refusedPersmissions,
-               bool isSynchronized);
+               int ExecuteAssembly (string assemblyFile);
+               int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity);
+               int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity, string[] args);
 
-       void DoCallBack (CrossAppDomainDelegate theDelegate);
-       bool Equals (object other);
+               Assembly[] GetAssemblies ();
+               object GetData (string name);
+               int GetHashCode();
+               object GetLifetimeService ();
+               Type GetType ();
+               object InitializeLifetimeService ();
 
-       int ExecuteAssembly (string assemblyFile);
-       int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity);
-       int ExecuteAssembly (
-               string assemblyFile,
-               Evidence assemblySecurity,
-               string[] args);
+               Assembly Load (AssemblyName assemblyRef);
+               Assembly Load (byte[] rawAssembly);
+               Assembly Load (string assemblyString);
+               Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity);
+               Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore);
+               Assembly Load (string assemblyString, Evidence assemblySecurity);
+               Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore, Evidence securityEvidence);
 
-       Assembly[] GetAssemblies ();
-       object GetData (string name);
-       int GetHashCode();
-       object GetLifetimeService ();
-       Type GetType ();
-       object InitializeLifetimeService ();
-
-       Assembly Load (AssemblyName assemblyRef);
-       Assembly Load (byte[] rawAssembly);
-       Assembly Load (string assemblyString);
-       Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity);
-       Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore);
-       Assembly Load (string assemblyString, Evidence assemblySecurity);
-       Assembly Load (
-               byte[] rawAssembly,
-               byte[] rawSymbolStore,
-               Evidence securityEvidence);
-
-       void SetAppDomainPolicy (PolicyLevel domainPolicy);
-       void SetCachePath (string s);
-       void SetData (string name, object data);
-       void SetPrincipalPolicy (PrincipalPolicy policy);
-       void SetShadowCopyPath (string s);
-       void SetThreadPrincipal (IPrincipal principal);
-       string ToString ();
-
-       event AssemblyLoadEventHandler AssemblyLoad;
-       event ResolveEventHandler AssemblyResolve;
-       event EventHandler DomainUnload;
-       event EventHandler ProcessExit;
-       event ResolveEventHandler ResourceResolve;
-       event ResolveEventHandler TypeResolve;
-       event UnhandledExceptionEventHandler UnhandledException;
-}
+               void SetAppDomainPolicy (PolicyLevel domainPolicy);
+               void SetCachePath (string s);
+               void SetData (string name, object data);
+               void SetPrincipalPolicy (PrincipalPolicy policy);
+               void SetShadowCopyPath (string s);
+               void SetThreadPrincipal (IPrincipal principal);
+               string ToString ();
 
+               event AssemblyLoadEventHandler AssemblyLoad;
+               event ResolveEventHandler AssemblyResolve;
+               event EventHandler DomainUnload;
+               event EventHandler ProcessExit;
+               event ResolveEventHandler ResourceResolve;
+               event ResolveEventHandler TypeResolve;
+               event UnhandledExceptionEventHandler UnhandledException;
+       }
 }