API compatibility work
authorMarek Safar <marek.safar@gmail.com>
Mon, 8 Nov 2010 19:28:37 +0000 (19:28 +0000)
committerMarek Safar <marek.safar@gmail.com>
Mon, 8 Nov 2010 19:29:49 +0000 (19:29 +0000)
19 files changed:
mcs/class/System.Drawing/System.Drawing/ComIStreamMarshaler.cs
mcs/class/corlib/System.Collections.ObjectModel/Collection.cs
mcs/class/corlib/System.Collections.ObjectModel/KeyedCollection.cs
mcs/class/corlib/System.Collections.ObjectModel/ReadOnlyCollection.cs
mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs
mcs/class/corlib/System.Reflection/CustomAttributeNamedArgument.cs
mcs/class/corlib/System.Reflection/CustomAttributeTypedArgument.cs
mcs/class/corlib/System.Reflection/Module.cs
mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs
mcs/class/corlib/System.Runtime/TargetedPatchingOptOutAttribute.cs
mcs/class/corlib/System/CharEnumerator.cs
mcs/class/corlib/System/DateTime.cs
mcs/class/corlib/System/DateTimeOffset.cs
mcs/class/corlib/System/Double.cs
mcs/class/corlib/System/IObserver.cs
mcs/class/corlib/System/Nullable.cs
mcs/class/corlib/System/Single.cs
mcs/class/corlib/System/String.cs
mcs/class/corlib/System/TimeSpan.cs

index 4842d15cef314ca1dd5e59de830bc985dab2385b..1abe9afd2affdcd7880e41ea1138053ae9729695 100644 (file)
@@ -38,12 +38,8 @@ using System;
 using System.IO;
 using System.Reflection;
 using System.Runtime.InteropServices;
-#if NET_2_0
 using System.Runtime.InteropServices.ComTypes;
 using STATSTG = System.Runtime.InteropServices.ComTypes.STATSTG;
-#else
-using IStream = System.Runtime.InteropServices.UCOMIStream;
-#endif
 
 namespace System.Drawing
 {
@@ -717,4 +713,4 @@ namespace System.Drawing
                        return -1;
                }
        }
-}
\ No newline at end of file
+}
index a9d8d92c9825b6c00fa00f69b7fbb5545af56bc8..f78afdc7b068fd14e1f2dc5b38d958fcb9ea09cd 100644 (file)
@@ -38,11 +38,14 @@ using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
+using System.Diagnostics;
 
 namespace System.Collections.ObjectModel
 {
        [ComVisible (false)]
        [Serializable]
+       [DebuggerDisplay ("Count={Count}")]
+       [DebuggerTypeProxy (typeof (CollectionDebuggerView<>))] 
        public class Collection <T> : IList <T>, ICollection <T>, IEnumerable <T>, IList, ICollection, IEnumerable
        {
                IList <T> list;
index 8866a0c68b33b3bc1205225fdca064a75065a2c7..60b8d565a1b9c0e95a906ae5fceafbbc8332339d 100644 (file)
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
+using System.Diagnostics;
 
 namespace System.Collections.ObjectModel
 {
        [ComVisible(false)]
        [Serializable]
+       [DebuggerDisplay ("Count={Count}")]
+       [DebuggerTypeProxy (typeof (CollectionDebuggerView<,>))]        
        public abstract class KeyedCollection<TKey, TItem> : Collection<TItem>
        {
                private Dictionary<TKey, TItem> dictionary;
index 46dfd7be9919489dcd7ee4452fbd527dfe2fe7be..58801389777f59d06df8b42fa3c53f28776d0e0a 100644 (file)
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
+using System.Diagnostics;
 
 namespace System.Collections.ObjectModel
 {
        [ComVisible (false)]
        [Serializable]
+       [DebuggerDisplay ("Count={Count}")]
+       [DebuggerTypeProxy (typeof (CollectionDebuggerView<>))] 
        public class ReadOnlyCollection <T> : IList <T>, ICollection <T>, IEnumerable <T>, IList, ICollection, IEnumerable
        {
                IList <T> list;
index 71eb132dbcd9d8c71c1a898e33a8732e28accf10..652be5edc402594180b5efde21eeb979f59f5918 100644 (file)
@@ -533,20 +533,20 @@ namespace System.Reflection.Emit
                        return new NotSupportedException ("The invoked member is not supported in a dynamic module.");
                }
 
-               public override MethodInfo MakeGenericMethod (params Type [] methodInstantiation)
+               public override MethodInfo MakeGenericMethod (params Type [] typeArguments)
                {
                        if (!IsGenericMethodDefinition)
                                throw new InvalidOperationException ("Method is not a generic method definition");
-                       if (methodInstantiation == null)
-                               throw new ArgumentNullException ("methodInstantiation");
-                       if (generic_params.Length != methodInstantiation.Length)
-                               throw new ArgumentException ("Incorrect length", "methodInstantiation");
-                       foreach (Type type in methodInstantiation) {
+                       if (typeArguments == null)
+                               throw new ArgumentNullException ("typeArguments");
+                       if (generic_params.Length != typeArguments.Length)
+                               throw new ArgumentException ("Incorrect length", "typeArguments");
+                       foreach (Type type in typeArguments) {
                                if (type == null)
-                                       throw new ArgumentNullException ("methodInstantiation");
+                                       throw new ArgumentNullException ("typeArguments");
                        }
 
-                       return new MethodOnTypeBuilderInst (this, methodInstantiation);
+                       return new MethodOnTypeBuilderInst (this, typeArguments);
                }
 
                public override bool IsGenericMethodDefinition {
index 1d66a3700dd0d49644c51e219f560f8c32860ee5..53034419816f83fd65921ba3f922f08d54223f31 100644 (file)
@@ -37,12 +37,23 @@ namespace System.Reflection {
        public struct CustomAttributeNamedArgument {
                CustomAttributeTypedArgument typedArgument;
                MemberInfo memberInfo;
-
-               internal CustomAttributeNamedArgument (MemberInfo memberInfo, object typedArgument)
+               
+#if NET_4_0
+               public
+#endif
+               CustomAttributeNamedArgument (MemberInfo memberInfo, object value)
+               {
+                       this.memberInfo = memberInfo;
+                       this.typedArgument = (CustomAttributeTypedArgument) value;
+               }
+               
+#if NET_4_0
+               public CustomAttributeNamedArgument (MemberInfo memberInfo, CustomAttributeTypedArgument typedArgument)
                {
                        this.memberInfo = memberInfo;
-                       this.typedArgument = (CustomAttributeTypedArgument) typedArgument;
+                       this.typedArgument = typedArgument;
                }
+#endif
 
                public MemberInfo MemberInfo {
                        get {
index 1552b4b5204ceec82e2bc7d40ad16cd9d53c74e6..c73e32c9a949f817af86a8ae42ed854606be4613 100644 (file)
@@ -40,8 +40,14 @@ namespace System.Reflection {
                Type argumentType;
                object value;
 
-               internal CustomAttributeTypedArgument (Type argumentType, object value)
+#if NET_4_0
+               public
+#endif
+               CustomAttributeTypedArgument (Type argumentType, object value)
                {
+                       if (argumentType == null)
+                               throw new ArgumentNullException ("argumentType");
+
                        this.argumentType = argumentType;
                        this.value = value;
 
@@ -56,6 +62,17 @@ namespace System.Reflection {
                                this.value = new ReadOnlyCollection <CustomAttributeTypedArgument> (new_value);
                        }
                }
+               
+#if NET_4_0
+               public CustomAttributeTypedArgument (object value)
+               {
+                       if (value == null)
+                               throw new ArgumentNullException ("value");
+
+                       this.argumentType = value.GetType ();
+                       this.value = value;
+               }
+#endif
 
                public Type ArgumentType {
                        get {
index f30dea26504604cda8ef42426254437095553e4f..5e936dce9c5f12d98ed203084c8a994b3bdd8c07 100644 (file)
@@ -291,9 +291,9 @@ namespace System.Reflection {
                }
 
 #if NET_4_0
-               public override bool Equals (object obj)
+               public override bool Equals (object o)
                {
-                       return obj == (object) this;
+                       return o == (object) this;
                }
 
                public override int GetHashCode ()
index 4a8672b28583003b1d1cecfe1d90c6f61d746ad8..fb12c07110e4522e27c417097c2768fa6ac49650 100644 (file)
@@ -150,6 +150,6 @@ namespace System.Runtime.CompilerServices
                }
 
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
-               public static extern void RunModuleConstructor (IntPtr module);
+               static extern void RunModuleConstructor (IntPtr module);
        }
 }
index 23854a4cf5c302c5a3b53d1964af292bf26744ca..cdf75e3b00ff71e4561f7bc855fbd9b6c5d5c9c1 100644 (file)
@@ -38,9 +38,6 @@ namespace System.Runtime {
        {
                string reason;
 
-               public TargetedPatchingOptOutAttribute () : this ("") {
-               }
-
                public TargetedPatchingOptOutAttribute (string reason)
                {
                        if (reason == null)
@@ -48,8 +45,7 @@ namespace System.Runtime {
                        this.reason = reason;
                }
 
-               public string Reason
-               {
+               public string Reason {
                        get {
                                return reason;
                        }
index 3da209a3d4f7d3abdeb42a77db361cc5a348421d..16e2cc3029b1ef5298a86ab0f853ed69fc8c9cfd 100644 (file)
@@ -69,6 +69,15 @@ namespace System
                                return Current;
                        }
                }
+               
+#if NET_4_0
+               public void Dispose ()
+#else
+               void IDisposable.Dispose ()
+#endif
+               {
+                       // nop
+               }               
 
                // Methods
                public object Clone ()
@@ -105,10 +114,5 @@ namespace System
                {
                        index = -1;
                }
-
-               void IDisposable.Dispose ()
-               {
-                       // nop
-               }
        }
 }
index 54f8b5b282ebfb7496adc019044cff6fb3dd4861..ddcd34a1a7acfcb79d7ff1ad20a3cf49c03c1f3b 100644 (file)
@@ -53,7 +53,7 @@ namespace System
                // memory usage from 16 to 8 bytes, see bug: 592221.   This also fixes the
                // 622127 issue and simplifies the code in reflection.c to encode DateTimes
                //
-               public long encoded;
+               long encoded;
                const long TicksMask = 0x3fffffffffffffff;
                const long KindMask = unchecked ((long) 0xc000000000000000);
                const int KindShift = 62;
index 1ba389774dd0243dc870162eea82e089d4d02f6e..ffb58892a4e0852e9b992ae97f4ae27cebb599e1 100644 (file)
@@ -122,9 +122,9 @@ namespace System
                        return new DateTimeOffset (dt.AddHours (hours).Ticks, utc_offset);
                }
 
-               public static DateTimeOffset operator + (DateTimeOffset dateTimeTz, TimeSpan timeSpan)
+               public static DateTimeOffset operator + (DateTimeOffset dateTimeOffset, TimeSpan timeSpan)
                {
-                       return dateTimeTz.Add (timeSpan);
+                       return dateTimeOffset.Add (timeSpan);
                }
 
                public DateTimeOffset AddMilliseconds (double milliseconds)
@@ -692,9 +692,9 @@ namespace System
                        return left.Subtract (right);
                }
 
-               public static DateTimeOffset operator - (DateTimeOffset dateTimeTz, TimeSpan timeSpan)
+               public static DateTimeOffset operator - (DateTimeOffset dateTimeOffset, TimeSpan timeSpan)
                {
-                       return dateTimeTz.Subtract (timeSpan);  
+                       return dateTimeOffset.Subtract (timeSpan);      
                }
 
                public long ToFileTime ()
index 53aa6389f9974e284bbf478bb3b3f96478115d8a..508de29fc7b177402a5b892150adaf20eb96b68b 100644 (file)
@@ -141,34 +141,34 @@ namespace System {
                }
 
 #if    NET_4_0
-               public static bool operator==(double a, double b)
+               public static bool operator==(double left, double right)
                {
-                       return a == b;
+                       return left == right;
                }
 
-               public static bool operator!=(double a, double b)
+               public static bool operator!=(double left, double right)
                {
-                       return a != b;
+                       return left != right;
                }
 
-               public static bool operator>(double a, double b)
+               public static bool operator>(double left, double right)
                {
-                       return a > b;
+                       return left > right;
                }
 
-               public static bool operator>=(double a, double b)
+               public static bool operator>=(double left, double right)
                {
-                       return a >= b;
+                       return left >= right;
                }
 
-               public static bool operator<(double a, double b)
+               public static bool operator<(double left, double right)
                {
-                       return a < b;
+                       return left < right;
                }
 
-               public static bool operator<=(double a, double b)
+               public static bool operator<=(double left, double right)
                {
-                       return a <= b;
+                       return left <= right;
                }
 #endif
 
index e352c4c9305435507f0e5793119d075e7dca5763..2201e067483c0580f2604989f519d0788b8033cf 100644 (file)
@@ -33,8 +33,8 @@ namespace System
        public interface IObserver<in T>
        {
                void OnCompleted ();
-               void OnError (Exception exception);
-               void OnNext(T arg);
+               void OnError (Exception error);
+               void OnNext(T value);
        }
 }
 
index 7f485432c544f0ea498e4d23683225af2a611136..5ebdbf4b23dc62df6848c5589815f0718dc5d349 100644 (file)
@@ -43,30 +43,30 @@ namespace System
 #if NET_2_1
                [ComVisible (false)]
 #endif
-               public static int Compare<T> (T? value1, T? value2) where T: struct
+               public static int Compare<T> (T? n1, T? n2) where T: struct
                {
-                       if (value1.has_value) {
-                               if (!value2.has_value)
+                       if (n1.has_value) {
+                               if (!n2.has_value)
                                        return 1;
 
-                               return Comparer<T>.Default.Compare (value1.value, value2.value);
+                               return Comparer<T>.Default.Compare (n1.value, n2.value);
                        }
                        
-                       return value2.has_value ? -1 : 0;
+                       return n2.has_value ? -1 : 0;
                }
 
 #if NET_2_1
                [ComVisible (false)]
 #endif
-               public static bool Equals<T> (T? value1, T? value2) where T: struct
+               public static bool Equals<T> (T? n1, T? n2) where T: struct
                {
-                       if (value1.has_value != value2.has_value)
+                       if (n1.has_value != n2.has_value)
                                return false;
 
-                       if (!value1.has_value)
+                       if (!n1.has_value)
                                return true;
 
-                       return EqualityComparer<T>.Default.Equals (value1.value, value2.value);
+                       return EqualityComparer<T>.Default.Equals (n1.value, n2.value);
                }
 
                public static Type GetUnderlyingType (Type nullableType)
index 210dc39cefa2180b7a41295f8ca7d789f5199443..de0f7c4ea1a5a137cb1a78c805984adb4fc98b4a 100644 (file)
@@ -144,34 +144,34 @@ namespace System
                }
 
 #if    NET_4_0
-               public static bool operator==(float a, float b)
+               public static bool operator==(float left, float right)
                {
-                       return a == b;
+                       return left == right;
                }
 
-               public static bool operator!=(float a, float b)
+               public static bool operator!=(float left, float right)
                {
-                       return a != b;
+                       return left != right;
                }
 
-               public static bool operator>(float a, float b)
+               public static bool operator>(float left, float right)
                {
-                       return a > b;
+                       return left > right;
                }
 
-               public static bool operator>=(float a, float b)
+               public static bool operator>=(float left, float right)
                {
-                       return a >= b;
+                       return left >= right;
                }
 
-               public static bool operator<(float a, float b)
+               public static bool operator<(float left, float right)
                {
-                       return a < b;
+                       return left < right;
                }
 
-               public static bool operator<=(float a, float b)
+               public static bool operator<=(float left, float right)
                {
-                       return a <= b;
+                       return left <= right;
                }
 #endif
 
index 70e9c01ed46587b315e85db31b64816b34227e04..2a084fb71edb8e1258ab5c08db3e004bfdfe7286 100644 (file)
@@ -2209,7 +2209,7 @@ namespace System
                        return InternalIsInterned (str);
                }
        
-               public static string Join (string separator, string [] value)
+               public static string Join (string separator, params string [] value)
                {
                        if (value == null)
                                throw new ArgumentNullException ("value");
index 7bc83f09a2052d80e8a55b07d6cc5185879b4afc..163a7aa7384164277b13586ba95f810d61b8358d 100644 (file)
@@ -360,25 +360,25 @@ namespace System
                }
 
 #if NET_4_0 || MOONLIGHT
-               public static TimeSpan Parse (string s, IFormatProvider formatProvider)
+               public static TimeSpan Parse (string input, IFormatProvider formatProvider)
                {
-                       if (s == null)
-                               throw new ArgumentNullException ("s");
+                       if (input == null)
+                               throw new ArgumentNullException ("input");
 
                        TimeSpan result;
-                       Parser p = new Parser (s, formatProvider);
+                       Parser p = new Parser (input, formatProvider);
                        p.Execute (false, out result);
                        return result;
                }
 
-               public static bool TryParse (string s, IFormatProvider formatProvider, out TimeSpan result)
+               public static bool TryParse (string input, IFormatProvider formatProvider, out TimeSpan result)
                {
-                       if (s == null || s.Length == 0) {
+                       if (string.IsNullOrEmpty (input)) {
                                result = TimeSpan.Zero;
                                return false;
                        }
 
-                       Parser p = new Parser (s, formatProvider);
+                       Parser p = new Parser (input, formatProvider);
                        return p.Execute (true, out result);
                }