Add test from Jb Evain to test biner with user method types
[mono.git] / mcs / class / corlib / System.Reflection / MethodBase.cs
index 7e538f451e7ac22c78595b6b94a197ca66dcca27..294a71e4c33e4ab191a7fdf7dc40bcb26136cee0 100644 (file)
@@ -42,8 +42,11 @@ namespace System.Reflection {
        [ComDefaultInterfaceAttribute (typeof (_MethodBase))]
        [Serializable]
        [ClassInterface(ClassInterfaceType.None)]
+#if MOBILE
+       public abstract class MethodBase: MemberInfo {
+#else
        public abstract class MethodBase: MemberInfo, _MethodBase {
-
+#endif
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
                public extern static MethodBase GetCurrentMethod ();
 
@@ -87,10 +90,18 @@ namespace System.Reflection {
                //
                // This is a quick version for our own use. We should override
                // it where possible so that it does not allocate an array.
+               // They cannot be abstract otherwise we break public contract
                //
-               internal virtual int GetParameterCount ()
+               internal virtual ParameterInfo[] GetParametersInternal ()
+               {
+                       // Override me
+                       return GetParameters ();
+               }
+
+               internal virtual int GetParametersCount ()
                {
-                       throw new NotImplementedException ("must be implemented");
+                       // Override me
+                       return GetParametersInternal ().Length;
                }
 
                internal virtual Type GetParameterType (int pos) {
@@ -279,6 +290,7 @@ namespace System.Reflection {
                }
 #endif
 
+#if !MOBILE
                void _MethodBase.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
                {
                        throw new NotImplementedException ();
@@ -304,5 +316,6 @@ namespace System.Reflection {
                {
                        throw new NotImplementedException ();
                }
+#endif
        }
 }