2 using System.Reflection.Emit;
5 using System.Runtime.CompilerServices;
7 namespace System.Reflection
9 partial class MethodBase
12 // This is a quick version for our own use. We should override
13 // it where possible so that it does not allocate an array.
14 // They cannot be abstract otherwise we break public contract
16 internal virtual ParameterInfo[] GetParametersInternal ()
19 return GetParameters ();
22 internal virtual int GetParametersCount ()
25 return GetParametersInternal ().Length;
28 internal virtual Type GetParameterType (int pos)
30 throw new NotImplementedException ();
33 internal virtual int get_next_table_index (object obj, int table, bool inc) {
35 if (this is MethodBuilder) {
36 MethodBuilder mb = (MethodBuilder)this;
37 return mb.get_next_table_index (obj, table, inc);
39 if (this is ConstructorBuilder) {
40 ConstructorBuilder mb = (ConstructorBuilder)this;
41 return mb.get_next_table_index (obj, table, inc);
44 throw new Exception ("Method is not a builder method");
47 internal static MethodBase GetMethodFromHandleNoGenericCheck (RuntimeMethodHandle handle)
49 return GetMethodFromHandleInternalType (handle.Value, IntPtr.Zero);
52 [MethodImplAttribute (MethodImplOptions.InternalCall)]
53 internal extern static MethodBody GetMethodBodyInternal (IntPtr handle);
55 internal static MethodBody GetMethodBody (IntPtr handle)
57 return GetMethodBodyInternal (handle);
60 [MethodImplAttribute (MethodImplOptions.InternalCall)]
61 extern static MethodBase GetMethodFromHandleInternalType (IntPtr method_handle, IntPtr type_handle);