MethodBuilder.cs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. //
  2. // System.Reflection.Emit/MethodBuilder.cs
  3. //
  4. // Author:
  5. // Paolo Molaro ([email protected])
  6. //
  7. // (C) 2001 Ximian, Inc. http://www.ximian.com
  8. //
  9. //
  10. // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
  11. //
  12. // Permission is hereby granted, free of charge, to any person obtaining
  13. // a copy of this software and associated documentation files (the
  14. // "Software"), to deal in the Software without restriction, including
  15. // without limitation the rights to use, copy, modify, merge, publish,
  16. // distribute, sublicense, and/or sell copies of the Software, and to
  17. // permit persons to whom the Software is furnished to do so, subject to
  18. // the following conditions:
  19. //
  20. // The above copyright notice and this permission notice shall be
  21. // included in all copies or substantial portions of the Software.
  22. //
  23. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  24. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  25. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  26. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  27. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  28. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  29. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  30. //
  31. using System;
  32. using System.Reflection;
  33. using System.Reflection.Emit;
  34. using System.Globalization;
  35. using System.Security;
  36. using System.Security.Permissions;
  37. using System.Runtime.CompilerServices;
  38. using System.Runtime.InteropServices;
  39. using System.Diagnostics.SymbolStore;
  40. namespace System.Reflection.Emit
  41. {
  42. [ComVisible (true)]
  43. [ComDefaultInterface (typeof (_MethodBuilder))]
  44. [ClassInterface (ClassInterfaceType.None)]
  45. public sealed class MethodBuilder : MethodInfo, _MethodBuilder
  46. {
  47. #pragma warning disable 169, 414
  48. private RuntimeMethodHandle mhandle;
  49. private Type rtype;
  50. internal Type[] parameters;
  51. private MethodAttributes attrs; /* It's used directly by MCS */
  52. private MethodImplAttributes iattrs;
  53. private string name;
  54. private int table_idx;
  55. private byte[] code;
  56. private ILGenerator ilgen;
  57. private TypeBuilder type;
  58. internal ParameterBuilder[] pinfo;
  59. private CustomAttributeBuilder[] cattrs;
  60. private MethodInfo override_method;
  61. private string pi_dll;
  62. private string pi_entry;
  63. private CharSet charset;
  64. private uint extra_flags; /* this encodes set_last_error etc */
  65. private CallingConvention native_cc;
  66. private CallingConventions call_conv;
  67. private bool init_locals = true;
  68. private IntPtr generic_container;
  69. internal GenericTypeParameterBuilder[] generic_params;
  70. private Type[] returnModReq;
  71. private Type[] returnModOpt;
  72. private Type[][] paramModReq;
  73. private Type[][] paramModOpt;
  74. private RefEmitPermissionSet[] permissions;
  75. #pragma warning restore 169, 414
  76. internal MethodBuilder (TypeBuilder tb, string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] returnModReq, Type[] returnModOpt, Type[] parameterTypes, Type[][] paramModReq, Type[][] paramModOpt)
  77. {
  78. this.name = name;
  79. this.attrs = attributes;
  80. this.call_conv = callingConvention;
  81. this.rtype = returnType;
  82. this.returnModReq = returnModReq;
  83. this.returnModOpt = returnModOpt;
  84. this.paramModReq = paramModReq;
  85. this.paramModOpt = paramModOpt;
  86. // The MSDN docs does not specify this, but the MS MethodBuilder
  87. // appends a HasThis flag if the method is not static
  88. if ((attributes & MethodAttributes.Static) == 0)
  89. this.call_conv |= CallingConventions.HasThis;
  90. if (parameterTypes != null) {
  91. for (int i = 0; i < parameterTypes.Length; ++i)
  92. if (parameterTypes [i] == null)
  93. throw new ArgumentException ("Elements of the parameterTypes array cannot be null", "parameterTypes");
  94. this.parameters = new Type [parameterTypes.Length];
  95. System.Array.Copy (parameterTypes, this.parameters, parameterTypes.Length);
  96. }
  97. type = tb;
  98. table_idx = get_next_table_index (this, 0x06, true);
  99. ((ModuleBuilder)tb.Module).RegisterToken (this, GetToken ().Token);
  100. }
  101. internal MethodBuilder (TypeBuilder tb, string name, MethodAttributes attributes,
  102. CallingConventions callingConvention, Type returnType, Type[] returnModReq, Type[] returnModOpt, Type[] parameterTypes, Type[][] paramModReq, Type[][] paramModOpt,
  103. String dllName, String entryName, CallingConvention nativeCConv, CharSet nativeCharset)
  104. : this (tb, name, attributes, callingConvention, returnType, returnModReq, returnModOpt, parameterTypes, paramModReq, paramModOpt)
  105. {
  106. pi_dll = dllName;
  107. pi_entry = entryName;
  108. native_cc = nativeCConv;
  109. charset = nativeCharset;
  110. }
  111. public override bool ContainsGenericParameters {
  112. get { throw new NotSupportedException (); }
  113. }
  114. public bool InitLocals {
  115. get {return init_locals;}
  116. set {init_locals = value;}
  117. }
  118. internal TypeBuilder TypeBuilder {
  119. get {return type;}
  120. }
  121. public override RuntimeMethodHandle MethodHandle {
  122. get {
  123. throw NotSupported ();
  124. }
  125. }
  126. public override Type ReturnType {
  127. get { return rtype; }
  128. }
  129. public override Type ReflectedType {
  130. get { return type; }
  131. }
  132. public override Type DeclaringType {
  133. get { return type; }
  134. }
  135. public override string Name {
  136. get { return name; }
  137. }
  138. public override MethodAttributes Attributes {
  139. get { return attrs; }
  140. }
  141. public override ICustomAttributeProvider ReturnTypeCustomAttributes {
  142. get { return null; }
  143. }
  144. public override CallingConventions CallingConvention {
  145. get { return call_conv; }
  146. }
  147. [MonoTODO("Not implemented")]
  148. public string Signature {
  149. get {
  150. throw new NotImplementedException ();
  151. }
  152. }
  153. /* Used by mcs */
  154. internal bool BestFitMapping {
  155. set {
  156. extra_flags = (uint) ((extra_flags & ~0x30) | (uint)(value ? 0x10 : 0x20));
  157. }
  158. }
  159. /* Used by mcs */
  160. internal bool ThrowOnUnmappableChar {
  161. set {
  162. extra_flags = (uint) ((extra_flags & ~0x3000) | (uint)(value ? 0x1000 : 0x2000));
  163. }
  164. }
  165. /* Used by mcs */
  166. internal bool ExactSpelling {
  167. set {
  168. extra_flags = (uint) ((extra_flags & ~0x01) | (uint)(value ? 0x01 : 0x00));
  169. }
  170. }
  171. /* Used by mcs */
  172. internal bool SetLastError {
  173. set {
  174. extra_flags = (uint) ((extra_flags & ~0x40) | (uint)(value ? 0x40 : 0x00));
  175. }
  176. }
  177. public MethodToken GetToken()
  178. {
  179. return new MethodToken(0x06000000 | table_idx);
  180. }
  181. public override MethodInfo GetBaseDefinition()
  182. {
  183. return this;
  184. }
  185. public override MethodImplAttributes GetMethodImplementationFlags()
  186. {
  187. return iattrs;
  188. }
  189. public override ParameterInfo[] GetParameters()
  190. {
  191. if (!type.is_created)
  192. throw NotSupported ();
  193. if (parameters == null)
  194. return null;
  195. ParameterInfo[] retval = new ParameterInfo [parameters.Length];
  196. for (int i = 0; i < parameters.Length; i++) {
  197. retval [i] = new ParameterInfo (pinfo == null ? null : pinfo [i + 1], parameters [i], this, i + 1);
  198. }
  199. return retval;
  200. }
  201. internal override int GetParameterCount ()
  202. {
  203. if (parameters == null)
  204. return 0;
  205. return parameters.Length;
  206. }
  207. public Module GetModule ()
  208. {
  209. return type.Module;
  210. }
  211. public void CreateMethodBody (byte[] il, int count)
  212. {
  213. if ((il != null) && ((count < 0) || (count > il.Length)))
  214. throw new ArgumentOutOfRangeException ("Index was out of range. Must be non-negative and less than the size of the collection.");
  215. if ((code != null) || type.is_created)
  216. throw new InvalidOperationException ("Type definition of the method is complete.");
  217. if (il == null)
  218. code = null;
  219. else {
  220. code = new byte [count];
  221. System.Array.Copy(il, code, count);
  222. }
  223. }
  224. public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
  225. {
  226. throw NotSupported ();
  227. }
  228. public override bool IsDefined (Type attributeType, bool inherit)
  229. {
  230. throw NotSupported ();
  231. }
  232. public override object[] GetCustomAttributes (bool inherit)
  233. {
  234. /*
  235. * On MS.NET, this always returns not_supported, but we can't do this
  236. * since there would be no way to obtain custom attributes of
  237. * dynamically created ctors.
  238. */
  239. if (type.is_created)
  240. return MonoCustomAttrs.GetCustomAttributes (this, inherit);
  241. else
  242. throw NotSupported ();
  243. }
  244. public override object[] GetCustomAttributes (Type attributeType, bool inherit)
  245. {
  246. if (type.is_created)
  247. return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
  248. else
  249. throw NotSupported ();
  250. }
  251. public ILGenerator GetILGenerator ()
  252. {
  253. return GetILGenerator (64);
  254. }
  255. public ILGenerator GetILGenerator (int size)
  256. {
  257. if (((iattrs & MethodImplAttributes.CodeTypeMask) !=
  258. MethodImplAttributes.IL) ||
  259. ((iattrs & MethodImplAttributes.ManagedMask) !=
  260. MethodImplAttributes.Managed))
  261. throw new InvalidOperationException ("Method body should not exist.");
  262. if (ilgen != null)
  263. return ilgen;
  264. ilgen = new ILGenerator (type.Module, ((ModuleBuilder)type.Module).GetTokenGenerator (), size);
  265. return ilgen;
  266. }
  267. public ParameterBuilder DefineParameter (int position, ParameterAttributes attributes, string strParamName)
  268. {
  269. RejectIfCreated ();
  270. //
  271. // Extension: Mono allows position == 0 for the return attribute
  272. //
  273. if ((position < 0) || (position > parameters.Length))
  274. throw new ArgumentOutOfRangeException ("position");
  275. ParameterBuilder pb = new ParameterBuilder (this, position, attributes, strParamName);
  276. if (pinfo == null)
  277. pinfo = new ParameterBuilder [parameters.Length + 1];
  278. pinfo [position] = pb;
  279. return pb;
  280. }
  281. internal void check_override ()
  282. {
  283. if (override_method != null && override_method.IsVirtual && !IsVirtual)
  284. throw new TypeLoadException (String.Format("Method '{0}' override '{1}' but it is not virtual", name, override_method));
  285. }
  286. internal void fixup ()
  287. {
  288. if (((attrs & (MethodAttributes.Abstract | MethodAttributes.PinvokeImpl)) == 0) && ((iattrs & (MethodImplAttributes.Runtime | MethodImplAttributes.InternalCall)) == 0)) {
  289. // do not allow zero length method body on MS.NET 2.0 (and higher)
  290. if (((ilgen == null) || (ilgen.ILOffset == 0)) && (code == null || code.Length == 0))
  291. throw new InvalidOperationException (
  292. String.Format ("Method '{0}.{1}' does not have a method body.",
  293. DeclaringType.FullName, Name));
  294. }
  295. if (ilgen != null)
  296. ilgen.label_fixup ();
  297. }
  298. internal void GenerateDebugInfo (ISymbolWriter symbolWriter)
  299. {
  300. if (ilgen != null && ilgen.HasDebugInfo) {
  301. SymbolToken token = new SymbolToken (GetToken().Token);
  302. symbolWriter.OpenMethod (token);
  303. symbolWriter.SetSymAttribute (token, "__name", System.Text.Encoding.UTF8.GetBytes (Name));
  304. ilgen.GenerateDebugInfo (symbolWriter);
  305. symbolWriter.CloseMethod ();
  306. }
  307. }
  308. public void SetCustomAttribute (CustomAttributeBuilder customBuilder)
  309. {
  310. if (customBuilder == null)
  311. throw new ArgumentNullException ("customBuilder");
  312. switch (customBuilder.Ctor.ReflectedType.FullName) {
  313. case "System.Runtime.CompilerServices.MethodImplAttribute":
  314. byte[] data = customBuilder.Data;
  315. int impla; // the (stupid) ctor takes a short or an int ...
  316. impla = (int)data [2];
  317. impla |= ((int)data [3]) << 8;
  318. iattrs |= (MethodImplAttributes)impla;
  319. return;
  320. case "System.Runtime.InteropServices.DllImportAttribute":
  321. CustomAttributeBuilder.CustomAttributeInfo attr = CustomAttributeBuilder.decode_cattr (customBuilder);
  322. bool preserveSig = true;
  323. /*
  324. * It would be easier to construct a DllImportAttribute from
  325. * the custom attribute builder, but the DllImportAttribute
  326. * does not contain all the information required here, ie.
  327. * - some parameters, like BestFitMapping has three values
  328. * ("on", "off", "missing"), but DllImportAttribute only
  329. * contains two (on/off).
  330. * - PreserveSig is true by default, while it is false by
  331. * default in DllImportAttribute.
  332. */
  333. pi_dll = (string)attr.ctorArgs[0];
  334. if (pi_dll == null || pi_dll.Length == 0)
  335. throw new ArgumentException ("DllName cannot be empty");
  336. native_cc = System.Runtime.InteropServices.CallingConvention.Winapi;
  337. for (int i = 0; i < attr.namedParamNames.Length; ++i) {
  338. string name = attr.namedParamNames [i];
  339. object value = attr.namedParamValues [i];
  340. if (name == "CallingConvention")
  341. native_cc = (CallingConvention)value;
  342. else if (name == "CharSet")
  343. charset = (CharSet)value;
  344. else if (name == "EntryPoint")
  345. pi_entry = (string)value;
  346. else if (name == "ExactSpelling")
  347. ExactSpelling = (bool)value;
  348. else if (name == "SetLastError")
  349. SetLastError = (bool)value;
  350. else if (name == "PreserveSig")
  351. preserveSig = (bool)value;
  352. else if (name == "BestFitMapping")
  353. BestFitMapping = (bool)value;
  354. else if (name == "ThrowOnUnmappableChar")
  355. ThrowOnUnmappableChar = (bool)value;
  356. }
  357. attrs |= MethodAttributes.PinvokeImpl;
  358. if (preserveSig)
  359. iattrs |= MethodImplAttributes.PreserveSig;
  360. return;
  361. case "System.Runtime.InteropServices.PreserveSigAttribute":
  362. iattrs |= MethodImplAttributes.PreserveSig;
  363. return;
  364. case "System.Runtime.CompilerServices.SpecialNameAttribute":
  365. attrs |= MethodAttributes.SpecialName;
  366. return;
  367. case "System.Security.SuppressUnmanagedCodeSecurityAttribute":
  368. attrs |= MethodAttributes.HasSecurity;
  369. break;
  370. }
  371. if (cattrs != null) {
  372. CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
  373. cattrs.CopyTo (new_array, 0);
  374. new_array [cattrs.Length] = customBuilder;
  375. cattrs = new_array;
  376. } else {
  377. cattrs = new CustomAttributeBuilder [1];
  378. cattrs [0] = customBuilder;
  379. }
  380. }
  381. [ComVisible (true)]
  382. public void SetCustomAttribute (ConstructorInfo con, byte[] binaryAttribute)
  383. {
  384. if (con == null)
  385. throw new ArgumentNullException ("con");
  386. if (binaryAttribute == null)
  387. throw new ArgumentNullException ("binaryAttribute");
  388. SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
  389. }
  390. public void SetImplementationFlags (MethodImplAttributes attributes)
  391. {
  392. RejectIfCreated ();
  393. iattrs = attributes;
  394. }
  395. public void AddDeclarativeSecurity (SecurityAction action, PermissionSet pset)
  396. {
  397. #if !NET_2_1
  398. if (pset == null)
  399. throw new ArgumentNullException ("pset");
  400. if ((action == SecurityAction.RequestMinimum) ||
  401. (action == SecurityAction.RequestOptional) ||
  402. (action == SecurityAction.RequestRefuse))
  403. throw new ArgumentOutOfRangeException ("Request* values are not permitted", "action");
  404. RejectIfCreated ();
  405. if (permissions != null) {
  406. /* Check duplicate actions */
  407. foreach (RefEmitPermissionSet set in permissions)
  408. if (set.action == action)
  409. throw new InvalidOperationException ("Multiple permission sets specified with the same SecurityAction.");
  410. RefEmitPermissionSet[] new_array = new RefEmitPermissionSet [permissions.Length + 1];
  411. permissions.CopyTo (new_array, 0);
  412. permissions = new_array;
  413. }
  414. else
  415. permissions = new RefEmitPermissionSet [1];
  416. permissions [permissions.Length - 1] = new RefEmitPermissionSet (action, pset.ToXml ().ToString ());
  417. attrs |= MethodAttributes.HasSecurity;
  418. #endif
  419. }
  420. [Obsolete ("An alternate API is available: Emit the MarshalAs custom attribute instead.")]
  421. public void SetMarshal (UnmanagedMarshal unmanagedMarshal)
  422. {
  423. RejectIfCreated ();
  424. throw new NotImplementedException ();
  425. }
  426. [MonoTODO]
  427. public void SetSymCustomAttribute (string name, byte[] data)
  428. {
  429. RejectIfCreated ();
  430. throw new NotImplementedException ();
  431. }
  432. public override string ToString()
  433. {
  434. return "MethodBuilder [" + type.Name + "::" + name + "]";
  435. }
  436. [MonoTODO]
  437. public override bool Equals (object obj)
  438. {
  439. return base.Equals (obj);
  440. }
  441. public override int GetHashCode ()
  442. {
  443. return name.GetHashCode ();
  444. }
  445. internal override int get_next_table_index (object obj, int table, bool inc)
  446. {
  447. return type.get_next_table_index (obj, table, inc);
  448. }
  449. internal void set_override (MethodInfo mdecl)
  450. {
  451. override_method = mdecl;
  452. }
  453. private void RejectIfCreated ()
  454. {
  455. if (type.is_created)
  456. throw new InvalidOperationException ("Type definition of the method is complete.");
  457. }
  458. private Exception NotSupported ()
  459. {
  460. return new NotSupportedException ("The invoked member is not supported in a dynamic module.");
  461. }
  462. public override MethodInfo MakeGenericMethod (params Type [] typeArguments)
  463. {
  464. if (!IsGenericMethodDefinition)
  465. throw new InvalidOperationException ("Method is not a generic method definition");
  466. if (typeArguments == null)
  467. throw new ArgumentNullException ("typeArguments");
  468. if (generic_params.Length != typeArguments.Length)
  469. throw new ArgumentException ("Incorrect length", "typeArguments");
  470. foreach (Type type in typeArguments) {
  471. if (type == null)
  472. throw new ArgumentNullException ("typeArguments");
  473. }
  474. return new MethodOnTypeBuilderInst (this, typeArguments);
  475. }
  476. public override bool IsGenericMethodDefinition {
  477. get {
  478. return generic_params != null;
  479. }
  480. }
  481. public override bool IsGenericMethod {
  482. get {
  483. return generic_params != null;
  484. }
  485. }
  486. public override MethodInfo GetGenericMethodDefinition ()
  487. {
  488. if (!IsGenericMethodDefinition)
  489. throw new InvalidOperationException ();
  490. return this;
  491. }
  492. public override Type[] GetGenericArguments ()
  493. {
  494. if (generic_params == null)
  495. return null;
  496. Type[] result = new Type [generic_params.Length];
  497. for (int i = 0; i < generic_params.Length; i++)
  498. result [i] = generic_params [i];
  499. return result;
  500. }
  501. public GenericTypeParameterBuilder[] DefineGenericParameters (params string[] names)
  502. {
  503. if (names == null)
  504. throw new ArgumentNullException ("names");
  505. if (names.Length == 0)
  506. throw new ArgumentException ("names");
  507. generic_params = new GenericTypeParameterBuilder [names.Length];
  508. for (int i = 0; i < names.Length; i++) {
  509. string item = names [i];
  510. if (item == null)
  511. throw new ArgumentNullException ("names");
  512. generic_params [i] = new GenericTypeParameterBuilder (type, this, item, i);
  513. }
  514. return generic_params;
  515. }
  516. public void SetReturnType (Type returnType)
  517. {
  518. rtype = returnType;
  519. }
  520. public void SetParameters (params Type[] parameterTypes)
  521. {
  522. if (parameterTypes != null) {
  523. for (int i = 0; i < parameterTypes.Length; ++i)
  524. if (parameterTypes [i] == null)
  525. throw new ArgumentException ("Elements of the parameterTypes array cannot be null", "parameterTypes");
  526. this.parameters = new Type [parameterTypes.Length];
  527. System.Array.Copy (parameterTypes, this.parameters, parameterTypes.Length);
  528. }
  529. }
  530. public void SetSignature (Type returnType, Type[] returnTypeRequiredCustomModifiers, Type[] returnTypeOptionalCustomModifiers, Type[] parameterTypes, Type[][] parameterTypeRequiredCustomModifiers, Type[][] parameterTypeOptionalCustomModifiers)
  531. {
  532. SetReturnType (returnType);
  533. SetParameters (parameterTypes);
  534. this.returnModReq = returnTypeRequiredCustomModifiers;
  535. this.returnModOpt = returnTypeOptionalCustomModifiers;
  536. this.paramModReq = parameterTypeRequiredCustomModifiers;
  537. this.paramModOpt = parameterTypeOptionalCustomModifiers;
  538. }
  539. public override Module Module {
  540. get {
  541. return base.Module;
  542. }
  543. }
  544. void _MethodBuilder.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
  545. {
  546. throw new NotImplementedException ();
  547. }
  548. void _MethodBuilder.GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo)
  549. {
  550. throw new NotImplementedException ();
  551. }
  552. void _MethodBuilder.GetTypeInfoCount (out uint pcTInfo)
  553. {
  554. throw new NotImplementedException ();
  555. }
  556. void _MethodBuilder.Invoke (uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
  557. {
  558. throw new NotImplementedException ();
  559. }
  560. }
  561. }