Author: atsushi
Date: 2007-08-08 08:50:35 -0400 (Wed, 08 Aug 2007)
New Revision: 83664

Modified:
   trunk/mcs/class/corlib/System/Attribute.cs
   trunk/mcs/class/corlib/System/ChangeLog
   trunk/mcs/class/corlib/System/ConsoleKeyInfo.cs
   trunk/mcs/class/corlib/System/Convert.cs
   trunk/mcs/class/corlib/System/DateTime.cs
   trunk/mcs/class/corlib/System/Enum.cs
   trunk/mcs/class/corlib/System/Exception.cs
   trunk/mcs/class/corlib/System/GC.cs
   trunk/mcs/class/corlib/System/IntPtr.cs
   trunk/mcs/class/corlib/System/Object.cs
   trunk/mcs/class/corlib/System/String.cs
   trunk/mcs/class/corlib/System/Version.cs
Log:
2007-08-08  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * GC.cs, Exception.cs, IntPtr.cs, Enum.cs, DateTime.cs, Convert.cs
          ConsoleKeyInfo.cs, String.cs, Object.cs, Attribute.cs,
          Version.cs : couple of cosmetic 2.0 API fixes.



Modified: trunk/mcs/class/corlib/System/Attribute.cs
===================================================================
--- trunk/mcs/class/corlib/System/Attribute.cs  2007-08-08 12:44:13 UTC (rev 
83663)
+++ trunk/mcs/class/corlib/System/Attribute.cs  2007-08-08 12:50:35 UTC (rev 
83664)
@@ -39,6 +39,7 @@
 
 #if NET_2_0
        [ComVisible (true)]
+       [ComDefaultInterface (typeof (_Attribute))]
 #endif
 
 #if NET_1_1

Modified: trunk/mcs/class/corlib/System/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System/ChangeLog     2007-08-08 12:44:13 UTC (rev 
83663)
+++ trunk/mcs/class/corlib/System/ChangeLog     2007-08-08 12:50:35 UTC (rev 
83664)
@@ -1,3 +1,9 @@
+2007-08-08  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * GC.cs, Exception.cs, IntPtr.cs, Enum.cs, DateTime.cs, Convert.cs
+         ConsoleKeyInfo.cs, String.cs, Object.cs, Attribute.cs,
+         Version.cs : couple of cosmetic 2.0 API fixes.
+
 2007-08-06  Aaron Bockover  <[EMAIL PROTECTED]>
 
        * Environment.cs (ReadXdgUserDir): Support the changes to the

Modified: trunk/mcs/class/corlib/System/ConsoleKeyInfo.cs
===================================================================
--- trunk/mcs/class/corlib/System/ConsoleKeyInfo.cs     2007-08-08 12:44:13 UTC 
(rev 83663)
+++ trunk/mcs/class/corlib/System/ConsoleKeyInfo.cs     2007-08-08 12:50:35 UTC 
(rev 83664)
@@ -87,6 +87,16 @@
                        return Equals ((ConsoleKeyInfo) o);
                }
                
+               public static bool operator == (ConsoleKeyInfo obj1, 
ConsoleKeyInfo obj2)
+               {
+                       return obj1.Equals (obj2);
+               }
+               
+               public static bool operator != (ConsoleKeyInfo obj1, 
ConsoleKeyInfo obj2)
+               {
+                       return !obj1.Equals (obj2);
+               }
+               
                public bool Equals (ConsoleKeyInfo o)
                {
                        return key == o.key && o.keychar == keychar && 
o.modifiers == modifiers;

Modified: trunk/mcs/class/corlib/System/Convert.cs
===================================================================
--- trunk/mcs/class/corlib/System/Convert.cs    2007-08-08 12:44:13 UTC (rev 
83663)
+++ trunk/mcs/class/corlib/System/Convert.cs    2007-08-08 12:50:35 UTC (rev 
83664)
@@ -218,7 +218,7 @@
                }
 
 #if NET_2_0
-               [ComVisible (true)]
+               [ComVisible (false)]
                public static string ToBase64String (byte[] inArray, 
Base64FormattingOptions options)
                {
                        if (inArray == null)
@@ -226,7 +226,7 @@
                        return ToBase64String (inArray, 0, inArray.Length, 
options);
                }
 
-               [ComVisible (true)]
+               [ComVisible (false)]
                public static string ToBase64String (byte[] inArray, int 
offset, int length, Base64FormattingOptions options)
                {
                        if (inArray == null)
@@ -243,6 +243,7 @@
                                return Encoding.ASCII.GetString 
(toBase64Transform.InternalTransformFinalBlock (inArray, offset, length));
                }
 
+               [ComVisible (false)]
                public static int ToBase64CharArray (byte[] inArray, int 
offsetIn, int length, 
                                                    char[] outArray, int 
offsetOut, Base64FormattingOptions options)
                {

Modified: trunk/mcs/class/corlib/System/DateTime.cs
===================================================================
--- trunk/mcs/class/corlib/System/DateTime.cs   2007-08-08 12:44:13 UTC (rev 
83663)
+++ trunk/mcs/class/corlib/System/DateTime.cs   2007-08-08 12:50:35 UTC (rev 
83664)
@@ -44,9 +44,6 @@
        /// 
        [Serializable]
        [StructLayout (LayoutKind.Auto)]
-#if NET_2_0
-       [System.Runtime.InteropServices.ComVisible (true)]
-#endif
        public struct DateTime : IFormattable, IConvertible, IComparable
 #if NET_2_0
                , IComparable<DateTime>, IEquatable <DateTime>

Modified: trunk/mcs/class/corlib/System/Enum.cs
===================================================================
--- trunk/mcs/class/corlib/System/Enum.cs       2007-08-08 12:44:13 UTC (rev 
83663)
+++ trunk/mcs/class/corlib/System/Enum.cs       2007-08-08 12:50:35 UTC (rev 
83664)
@@ -173,6 +173,9 @@
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
                private extern object get_value ();
 
+#if NET_2_0
+               [ComVisible (true)]
+#endif
                public static Array GetValues (Type enumType)
                {
                        if (enumType == null)
@@ -186,6 +189,9 @@
                        return (Array) info.values.Clone ();
                }
 
+#if NET_2_0
+               [ComVisible (true)]
+#endif
                public static string[] GetNames (Type enumType)
                {
                        if (enumType == null)
@@ -199,6 +205,9 @@
                        return (string []) info.names.Clone ();
                }
 
+#if NET_2_0
+               [ComVisible (true)]
+#endif
                public static string GetName (Type enumType, object value)
                {
                        if (enumType == null)
@@ -220,6 +229,9 @@
                        return null;
                }
 
+#if NET_2_0
+               [ComVisible (true)]
+#endif
                public static bool IsDefined (Type enumType, object value)
                {
                        if (enumType == null)
@@ -252,6 +264,9 @@
                        }
                }
 
+#if NET_2_0
+               [ComVisible (true)]
+#endif
                public static Type GetUnderlyingType (Type enumType)
                {
                        if (enumType == null)
@@ -265,6 +280,9 @@
                        return info.utype;
                }
 
+#if NET_2_0
+               [ComVisible (true)]
+#endif
                public static object Parse (Type enumType, string value)
                {
                        // Note: Parameters are checked in the other overload
@@ -306,6 +324,9 @@
 
                private static char [] split_char = { ',' };
 
+#if NET_2_0
+               [ComVisible (true)]
+#endif
                public static object Parse (Type enumType, string value, bool 
ignoreCase)
                {
                        if (enumType == null)
@@ -416,47 +437,74 @@
                        return Format (this.GetType(), this.get_value (), 
format);
                }
 
+#if NET_2_0
+               [ComVisible (true)]
+#endif
                public static object ToObject (Type enumType, byte value)
                {
                        return ToObject (enumType, (object)value);
                }
 
+#if NET_2_0
+               [ComVisible (true)]
+#endif
                public static object ToObject (Type enumType, short value)
                {
                        return ToObject (enumType, (object)value);
                }
 
+#if NET_2_0
+               [ComVisible (true)]
+#endif
                public static object ToObject (Type enumType, int value)
                {
                        return ToObject (enumType, (object)value);
                }
 
+#if NET_2_0
+               [ComVisible (true)]
+#endif
                public static object ToObject (Type enumType, long value)
                {
                        return ToObject (enumType, (object)value);
                }
 
+#if NET_2_0
+               [ComVisible (true)]
+#endif
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                public static extern object ToObject (Type enumType, object 
value);
 
+#if NET_2_0
+               [ComVisible (true)]
+#endif
                [CLSCompliant (false)]
                public static object ToObject (Type enumType, sbyte value)
                {
                        return ToObject (enumType, (object)value);
                }
 
+#if NET_2_0
+               [ComVisible (true)]
+#endif
                [CLSCompliant (false)]
                public static object ToObject (Type enumType, ushort value)
                {
                        return ToObject (enumType, (object)value);
                }
 
+#if NET_2_0
+               [ComVisible (true)]
+#endif
                [CLSCompliant (false)]
                public static object ToObject (Type enumType, uint value)
                {
                        return ToObject (enumType, (object)value);
                }
 
+#if NET_2_0
+               [ComVisible (true)]
+#endif
                [CLSCompliant (false)]
                public static object ToObject (Type enumType, ulong value)
                {
@@ -649,6 +697,9 @@
                        return retVal;
                }
 
+#if NET_2_0
+               [ComVisible (true)]
+#endif
                public static string Format (Type enumType, object value, 
string format)
                {
                        if (enumType == null)

Modified: trunk/mcs/class/corlib/System/Exception.cs
===================================================================
--- trunk/mcs/class/corlib/System/Exception.cs  2007-08-08 12:44:13 UTC (rev 
83663)
+++ trunk/mcs/class/corlib/System/Exception.cs  2007-08-08 12:50:35 UTC (rev 
83664)
@@ -40,9 +40,12 @@
 namespace System
 {
        [Serializable]
-       [ClassInterface (ClassInterfaceType.AutoDual)]
 #if NET_2_0
        [ComVisible(true)]
+       [ComDefaultInterface (typeof (_Exception))]
+       [ClassInterface (ClassInterfaceType.None)]
+#else
+       [ClassInterface (ClassInterfaceType.AutoDual)]
 #endif
        public class Exception : ISerializable 
 #if NET_2_0

Modified: trunk/mcs/class/corlib/System/GC.cs
===================================================================
--- trunk/mcs/class/corlib/System/GC.cs 2007-08-08 12:44:13 UTC (rev 83663)
+++ trunk/mcs/class/corlib/System/GC.cs 2007-08-08 12:50:35 UTC (rev 83664)
@@ -88,6 +88,9 @@
                public extern static long GetTotalMemory (bool 
forceFullCollection);
 
                /* this icall has weird semantics check the docs... */
+#if NET_2_0
+               [ReliabilityContract (Consistency.WillNotCorruptState, 
Cer.Success)]
+#endif
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
                public extern static void KeepAlive (object obj);
                

Modified: trunk/mcs/class/corlib/System/IntPtr.cs
===================================================================
--- trunk/mcs/class/corlib/System/IntPtr.cs     2007-08-08 12:44:13 UTC (rev 
83663)
+++ trunk/mcs/class/corlib/System/IntPtr.cs     2007-08-08 12:50:35 UTC (rev 
83664)
@@ -61,11 +61,17 @@
 
                public static readonly IntPtr Zero;
 
+#if NET_2_0
+               [ReliabilityContract (Consistency.MayCorruptInstance, 
Cer.MayFail)]
+#endif
                public IntPtr (int i32)
                {
                        value = (void *) i32;
                }
 
+#if NET_2_0
+               [ReliabilityContract (Consistency.MayCorruptInstance, 
Cer.MayFail)]
+#endif
                public IntPtr (long i64)
                {
                        if (((i64 > Int32.MaxValue) || (i64 < Int32.MinValue)) 
&& (IntPtr.Size < 8)) {
@@ -77,6 +83,9 @@
                }
 
                [CLSCompliant (false)]
+#if NET_2_0
+               [ReliabilityContract (Consistency.MayCorruptInstance, 
Cer.MayFail)]
+#endif
                unsafe public IntPtr (void *ptr)
                {
                        value = ptr;
@@ -145,6 +154,14 @@
 
                override public string ToString ()
                {
+                       return ToString (null);
+               }
+
+#if NET_2_0
+               public
+#endif
+               string ToString (string format)
+               {
                        if (Size == 4)
                                return ((int) value).ToString ();
                        else
@@ -168,7 +185,7 @@
                }
 
 #if NET_2_0
-               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, 
Cer.Success)]
+               [ReliabilityContractAttribute (Consistency.MayCorruptInstance, 
Cer.MayFail)]
 #endif
                public static explicit operator IntPtr (int value)
                {
@@ -176,7 +193,7 @@
                }
 
 #if NET_2_0
-               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, 
Cer.Success)]
+               [ReliabilityContractAttribute (Consistency.MayCorruptInstance, 
Cer.MayFail)]
 #endif
                public static explicit operator IntPtr (long value)
                {
@@ -184,7 +201,7 @@
                }
 
 #if NET_2_0
-               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, 
Cer.Success)]
+               [ReliabilityContractAttribute (Consistency.MayCorruptInstance, 
Cer.MayFail)]
 #endif         
                [CLSCompliant (false)]
                unsafe public static explicit operator IntPtr (void *value)

Modified: trunk/mcs/class/corlib/System/Object.cs
===================================================================
--- trunk/mcs/class/corlib/System/Object.cs     2007-08-08 12:44:13 UTC (rev 
83663)
+++ trunk/mcs/class/corlib/System/Object.cs     2007-08-08 12:50:35 UTC (rev 
83664)
@@ -73,6 +73,9 @@
                // <summary>
                //   Initializes a new instance of the object class.
                // </summary>
+#if NET_2_0
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, 
Cer.MayFail)]
+#endif
                public Object ()
                {
                }

Modified: trunk/mcs/class/corlib/System/String.cs
===================================================================
--- trunk/mcs/class/corlib/System/String.cs     2007-08-08 12:44:13 UTC (rev 
83663)
+++ trunk/mcs/class/corlib/System/String.cs     2007-08-08 12:50:35 UTC (rev 
83664)
@@ -1192,6 +1192,7 @@
                }
 
 #if NET_2_0
+               [ComVisible (false)]
                public bool StartsWith (string value, StringComparison 
comparisonType)
                {
                        switch (comparisonType) {
@@ -1212,6 +1213,7 @@
                        }
                }
 
+               [ComVisible (false)]
                public bool EndsWith (string value, StringComparison 
comparisonType)
                {
                        switch (comparisonType) {

Modified: trunk/mcs/class/corlib/System/Version.cs
===================================================================
--- trunk/mcs/class/corlib/System/Version.cs    2007-08-08 12:44:13 UTC (rev 
83663)
+++ trunk/mcs/class/corlib/System/Version.cs    2007-08-08 12:50:35 UTC (rev 
83664)
@@ -33,7 +33,7 @@
 
        [Serializable]
 #if NET_2_0
-       [ComVisible (false)]
+       [ComVisible (true)]
        public sealed class Version : ICloneable, IComparable, 
IComparable<Version>, IEquatable<Version> {
 #else
        public sealed class Version : ICloneable, IComparable {

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to