System_Exception_Binding.cs 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Reflection;
  5. using System.Runtime.InteropServices;
  6. using ILRuntime.CLR.TypeSystem;
  7. using ILRuntime.CLR.Method;
  8. using ILRuntime.Runtime.Enviorment;
  9. using ILRuntime.Runtime.Intepreter;
  10. using ILRuntime.Runtime.Stack;
  11. using ILRuntime.Reflection;
  12. using ILRuntime.CLR.Utils;
  13. namespace ILRuntime.Runtime.Generated
  14. {
  15. unsafe class System_Exception_Binding
  16. {
  17. public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
  18. {
  19. BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
  20. MethodBase method;
  21. Type[] args;
  22. Type type = typeof(System.Exception);
  23. args = new Type[]{};
  24. method = type.GetMethod("get_Data", flag, null, args, null);
  25. app.RegisterCLRMethodRedirection(method, get_Data_0);
  26. args = new Type[]{typeof(System.String)};
  27. method = type.GetConstructor(flag, null, args, null);
  28. app.RegisterCLRMethodRedirection(method, Ctor_0);
  29. args = new Type[]{typeof(System.String), typeof(System.Exception)};
  30. method = type.GetConstructor(flag, null, args, null);
  31. app.RegisterCLRMethodRedirection(method, Ctor_1);
  32. }
  33. static StackObject* get_Data_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  34. {
  35. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  36. StackObject* ptr_of_this_method;
  37. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  38. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  39. System.Exception instance_of_this_method = (System.Exception)typeof(System.Exception).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  40. __intp.Free(ptr_of_this_method);
  41. var result_of_this_method = instance_of_this_method.Data;
  42. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  43. }
  44. static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  45. {
  46. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  47. StackObject* ptr_of_this_method;
  48. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  49. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  50. System.String @message = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  51. __intp.Free(ptr_of_this_method);
  52. var result_of_this_method = new System.Exception(@message);
  53. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  54. }
  55. static StackObject* Ctor_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  56. {
  57. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  58. StackObject* ptr_of_this_method;
  59. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  60. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  61. System.Exception @innerException = (System.Exception)typeof(System.Exception).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  62. __intp.Free(ptr_of_this_method);
  63. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  64. System.String @message = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  65. __intp.Free(ptr_of_this_method);
  66. var result_of_this_method = new System.Exception(@message, @innerException);
  67. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  68. }
  69. }
  70. }