Kill GENERICS as the define to use to build the GENERICS build, that is now
[mono.git] / mcs / class / corlib / System.Reflection.Emit / MonoArrayMethod.cs
1 //
2 // System.Reflection/MonoMethod.cs
3 // The class used to represent methods from the mono runtime.
4 //
5 // Author:
6 //   Paolo Molaro (lupus@ximian.com)
7 //
8 // (C) 2001 Ximian, Inc.  http://www.ximian.com
9 //
10
11 using System;
12 using System.Globalization;
13 using System.Runtime.CompilerServices;
14 using System.Runtime.InteropServices;
15
16 namespace System.Reflection {
17         internal class MonoArrayMethod: MethodInfo {
18                 internal RuntimeMethodHandle mhandle;
19                 internal Type parent;
20                 internal Type ret;
21                 internal Type[] parameters;
22                 internal string name;
23                 internal int table_idx;
24                 internal CallingConventions call_conv;
25
26                 internal MonoArrayMethod (Type arrayClass, string methodName, CallingConventions callingConvention, Type returnType, Type[] parameterTypes) {
27                         name = methodName;
28                         parent = arrayClass;
29                         ret = returnType;
30                         parameters = (Type[])parameterTypes.Clone();
31                         call_conv = callingConvention;
32                 }
33                 
34                 [MonoTODO]
35                 public override MethodInfo GetBaseDefinition() {
36                         return this; /* FIXME */
37                 }
38                 public override Type ReturnType {
39                         get {
40                                 return ret;
41                         }
42                 }
43                 [MonoTODO]
44                 public override ICustomAttributeProvider ReturnTypeCustomAttributes { 
45                         get {return null;}
46                 }
47                 
48                 [MonoTODO]
49                 public override MethodImplAttributes GetMethodImplementationFlags() {
50                         return (MethodImplAttributes)0;
51                 }
52
53                 [MonoTODO]
54                 public override ParameterInfo[] GetParameters() {
55                         return new ParameterInfo [0];
56                 }
57
58                 [MonoTODO]
59                 public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) {
60                         throw new NotImplementedException ();
61                 }
62
63                 public override RuntimeMethodHandle MethodHandle { 
64                         get {return mhandle;} 
65                 }
66                 [MonoTODO]
67                 public override MethodAttributes Attributes { 
68                         get {
69                                 return (MethodAttributes)0;
70                         } 
71                 }
72                 
73                 public override Type ReflectedType {
74                         get {
75                                 return parent;
76                         }
77                 }
78                 public override Type DeclaringType {
79                         get {
80                                 return parent;
81                         }
82                 }
83                 public override string Name {
84                         get {
85                                 return name;
86                         }
87                 }
88                 
89                 public override bool IsDefined (Type attributeType, bool inherit) {
90                         return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
91                 }
92
93                 public override object[] GetCustomAttributes( bool inherit) {
94                         return MonoCustomAttrs.GetCustomAttributes (this, inherit);
95                 }
96                 public override object[] GetCustomAttributes( Type attributeType, bool inherit) {
97                         return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
98                 }
99
100                 public override string ToString () {
101                         string parms = "";
102                         ParameterInfo[] p = GetParameters ();
103                         for (int i = 0; i < p.Length; ++i) {
104                                 if (i > 0)
105                                         parms = parms + ", ";
106                                 parms = parms + p [i].ParameterType.Name;
107                         }
108                         return ReturnType.Name+" "+Name+"("+parms+")";
109                 }
110
111 #if NET_1_2
112                 public override Type[] GetGenericArguments ()
113                 {
114                         throw new NotImplementedException ();
115                 }
116 #endif
117         }
118 }