MonoArrayMethod.cs 2.8 KB

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