ETModel_Session_Binding.cs 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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 ETModel_Session_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(ETModel.Session);
  23. args = new Type[]{typeof(ETModel.IMessage)};
  24. method = type.GetMethod("Send", flag, null, args, null);
  25. app.RegisterCLRMethodRedirection(method, Send_0);
  26. args = new Type[]{};
  27. method = type.GetMethod("get_Error", flag, null, args, null);
  28. app.RegisterCLRMethodRedirection(method, get_Error_1);
  29. args = new Type[]{};
  30. method = type.GetMethod("get_Network", flag, null, args, null);
  31. app.RegisterCLRMethodRedirection(method, get_Network_2);
  32. args = new Type[]{typeof(System.Byte), typeof(System.UInt16), typeof(System.Object)};
  33. method = type.GetMethod("Send", flag, null, args, null);
  34. app.RegisterCLRMethodRedirection(method, Send_3);
  35. args = new Type[]{typeof(ETModel.IRequest)};
  36. method = type.GetMethod("Call", flag, null, args, null);
  37. app.RegisterCLRMethodRedirection(method, Call_4);
  38. }
  39. static StackObject* Send_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  40. {
  41. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  42. StackObject* ptr_of_this_method;
  43. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  44. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  45. ETModel.IMessage @message = (ETModel.IMessage)typeof(ETModel.IMessage).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  46. __intp.Free(ptr_of_this_method);
  47. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  48. ETModel.Session instance_of_this_method = (ETModel.Session)typeof(ETModel.Session).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  49. __intp.Free(ptr_of_this_method);
  50. instance_of_this_method.Send(@message);
  51. return __ret;
  52. }
  53. static StackObject* get_Error_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  54. {
  55. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  56. StackObject* ptr_of_this_method;
  57. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  58. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  59. ETModel.Session instance_of_this_method = (ETModel.Session)typeof(ETModel.Session).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  60. __intp.Free(ptr_of_this_method);
  61. var result_of_this_method = instance_of_this_method.Error;
  62. __ret->ObjectType = ObjectTypes.Integer;
  63. __ret->Value = result_of_this_method;
  64. return __ret + 1;
  65. }
  66. static StackObject* get_Network_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  67. {
  68. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  69. StackObject* ptr_of_this_method;
  70. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  71. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  72. ETModel.Session instance_of_this_method = (ETModel.Session)typeof(ETModel.Session).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  73. __intp.Free(ptr_of_this_method);
  74. var result_of_this_method = instance_of_this_method.Network;
  75. object obj_result_of_this_method = result_of_this_method;
  76. if(obj_result_of_this_method is CrossBindingAdaptorType)
  77. {
  78. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  79. }
  80. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  81. }
  82. static StackObject* Send_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  83. {
  84. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  85. StackObject* ptr_of_this_method;
  86. StackObject* __ret = ILIntepreter.Minus(__esp, 4);
  87. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  88. System.Object @message = (System.Object)typeof(System.Object).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  89. __intp.Free(ptr_of_this_method);
  90. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  91. System.UInt16 @opcode = (ushort)ptr_of_this_method->Value;
  92. ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
  93. System.Byte @flag = (byte)ptr_of_this_method->Value;
  94. ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
  95. ETModel.Session instance_of_this_method = (ETModel.Session)typeof(ETModel.Session).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  96. __intp.Free(ptr_of_this_method);
  97. instance_of_this_method.Send(@flag, @opcode, @message);
  98. return __ret;
  99. }
  100. static StackObject* Call_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  101. {
  102. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  103. StackObject* ptr_of_this_method;
  104. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  105. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  106. ETModel.IRequest @request = (ETModel.IRequest)typeof(ETModel.IRequest).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  107. __intp.Free(ptr_of_this_method);
  108. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  109. ETModel.Session instance_of_this_method = (ETModel.Session)typeof(ETModel.Session).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  110. __intp.Free(ptr_of_this_method);
  111. var result_of_this_method = instance_of_this_method.Call(@request);
  112. object obj_result_of_this_method = result_of_this_method;
  113. if(obj_result_of_this_method is CrossBindingAdaptorType)
  114. {
  115. return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
  116. }
  117. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  118. }
  119. }
  120. }