Merge pull request #1323 from StephenMcConnel/bug-23591
[mono.git] / mcs / class / corlib / System.Reflection / MethodInfo.cs
index 06d5a2f8720369710213a64e80de7b2c4a0aa8e3..74f96f55428f03dcc775dcd1c09698251f8af648 100644 (file)
@@ -37,8 +37,11 @@ namespace System.Reflection {
        [ComDefaultInterfaceAttribute (typeof (_MethodInfo))]
        [Serializable]
        [ClassInterface(ClassInterfaceType.None)]
+#if MOBILE
+       public abstract class MethodInfo: MethodBase {
+#else
        public abstract class MethodInfo: MethodBase, _MethodInfo {
-
+#endif
                public abstract MethodInfo GetBaseDefinition();
 
                internal virtual MethodInfo GetBaseMethod ()
@@ -58,6 +61,7 @@ namespace System.Reflection {
 
                public abstract ICustomAttributeProvider ReturnTypeCustomAttributes { get; }
 
+#if !MOBILE
                void _MethodInfo.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
                {
                        throw new NotImplementedException ();
@@ -83,6 +87,7 @@ namespace System.Reflection {
                {
                        throw new NotImplementedException ();
                }
+#endif
 
                [ComVisible (true)]
                public virtual MethodInfo GetGenericMethodDefinition ()
@@ -102,7 +107,7 @@ namespace System.Reflection {
                        return Type.EmptyTypes;
                }
 
-#if !NET_4_0 && !MOONLIGHT
+#if !NET_4_0
                public override bool IsGenericMethod {
                        get {
                                return false;
@@ -158,5 +163,16 @@ namespace System.Reflection {
                }
 #endif
 
+#if NET_4_5
+               public virtual Delegate CreateDelegate (Type delegateType)
+               {
+                       return Delegate.CreateDelegate (delegateType, this);
+               }
+
+               public virtual Delegate CreateDelegate (Type delegateType, object target)
+               {
+                       return Delegate.CreateDelegate (delegateType, target, this);
+               }
+#endif
        }
 }