2 // System.Reflection/MonoMethod.cs
3 // The class used to represent methods from the mono runtime.
6 // Paolo Molaro (lupus@ximian.com)
8 // (C) 2001 Ximian, Inc. http://www.ximian.com
12 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
14 // Permission is hereby granted, free of charge, to any person obtaining
15 // a copy of this software and associated documentation files (the
16 // "Software"), to deal in the Software without restriction, including
17 // without limitation the rights to use, copy, modify, merge, publish,
18 // distribute, sublicense, and/or sell copies of the Software, and to
19 // permit persons to whom the Software is furnished to do so, subject to
20 // the following conditions:
22 // The above copyright notice and this permission notice shall be
23 // included in all copies or substantial portions of the Software.
25 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
29 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
30 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
31 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35 using System.Globalization;
36 using System.Runtime.CompilerServices;
37 using System.Runtime.InteropServices;
39 namespace System.Reflection {
40 internal class MonoArrayMethod: MethodInfo {
41 internal RuntimeMethodHandle mhandle;
44 internal Type[] parameters;
46 internal int table_idx;
47 internal CallingConventions call_conv;
49 internal MonoArrayMethod (Type arrayClass, string methodName, CallingConventions callingConvention, Type returnType, Type[] parameterTypes) {
53 parameters = (Type[])parameterTypes.Clone();
54 call_conv = callingConvention;
58 public override MethodInfo GetBaseDefinition() {
59 return this; /* FIXME */
61 public override Type ReturnType {
67 public override ICustomAttributeProvider ReturnTypeCustomAttributes {
72 public override MethodImplAttributes GetMethodImplementationFlags() {
73 return (MethodImplAttributes)0;
77 public override ParameterInfo[] GetParameters() {
78 return new ParameterInfo [0];
82 public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) {
83 throw new NotImplementedException ();
86 public override RuntimeMethodHandle MethodHandle {
90 public override MethodAttributes Attributes {
92 return (MethodAttributes)0;
96 public override Type ReflectedType {
101 public override Type DeclaringType {
106 public override string Name {
112 public override bool IsDefined (Type attributeType, bool inherit) {
113 return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
116 public override object[] GetCustomAttributes( bool inherit) {
117 return MonoCustomAttrs.GetCustomAttributes (this, inherit);
119 public override object[] GetCustomAttributes( Type attributeType, bool inherit) {
120 return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
123 public override string ToString () {
124 string parms = String.Empty;
125 ParameterInfo[] p = GetParameters ();
126 for (int i = 0; i < p.Length; ++i) {
128 parms = parms + ", ";
129 parms = parms + p [i].ParameterType.Name;
131 return ReturnType.Name+" "+Name+"("+parms+")";