ModuleBuilder.pns.cs 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. //
  2. // ModuleBuilder.pns.cs
  3. //
  4. // Authors:
  5. // Marek Safar ([email protected])
  6. //
  7. // Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
  8. //
  9. // Permission is hereby granted, free of charge, to any person obtaining
  10. // a copy of this software and associated documentation files (the
  11. // "Software"), to deal in the Software without restriction, including
  12. // without limitation the rights to use, copy, modify, merge, publish,
  13. // distribute, sublicense, and/or sell copies of the Software, and to
  14. // permit persons to whom the Software is furnished to do so, subject to
  15. // the following conditions:
  16. //
  17. // The above copyright notice and this permission notice shall be
  18. // included in all copies or substantial portions of the Software.
  19. //
  20. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  21. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  22. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  23. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  24. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  25. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  26. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  27. //
  28. #if !MONO_FEATURE_SRE
  29. namespace System.Reflection.Emit
  30. {
  31. public partial class ModuleBuilder : System.Reflection.Module
  32. {
  33. internal ModuleBuilder() => throw new PlatformNotSupportedException();
  34. public override System.Reflection.Assembly Assembly { get { throw new PlatformNotSupportedException(); } }
  35. public override string FullyQualifiedName { get { throw new PlatformNotSupportedException(); } }
  36. public override string Name { get { throw new PlatformNotSupportedException(); } }
  37. public void CreateGlobalFunctions() => throw new PlatformNotSupportedException();
  38. public System.Reflection.Emit.EnumBuilder DefineEnum(string name, System.Reflection.TypeAttributes visibility, System.Type underlyingType) { throw new PlatformNotSupportedException(); }
  39. public System.Reflection.Emit.MethodBuilder DefineGlobalMethod(string name, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type returnType, System.Type[] parameterTypes) { throw new PlatformNotSupportedException(); }
  40. public System.Reflection.Emit.MethodBuilder DefineGlobalMethod(string name, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type returnType, System.Type[] requiredReturnTypeCustomModifiers, System.Type[] optionalReturnTypeCustomModifiers, System.Type[] parameterTypes, System.Type[][] requiredParameterTypeCustomModifiers, System.Type[][] optionalParameterTypeCustomModifiers) { throw new PlatformNotSupportedException(); }
  41. public System.Reflection.Emit.MethodBuilder DefineGlobalMethod(string name, System.Reflection.MethodAttributes attributes, System.Type returnType, System.Type[] parameterTypes) { throw new PlatformNotSupportedException(); }
  42. public System.Reflection.Emit.FieldBuilder DefineInitializedData(string name, byte[] data, System.Reflection.FieldAttributes attributes) { throw new PlatformNotSupportedException(); }
  43. public System.Reflection.Emit.MethodBuilder DefinePInvokeMethod(string name, string dllName, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type returnType, System.Type[] parameterTypes, System.Runtime.InteropServices.CallingConvention nativeCallConv, System.Runtime.InteropServices.CharSet nativeCharSet) { throw new PlatformNotSupportedException(); }
  44. public System.Reflection.Emit.MethodBuilder DefinePInvokeMethod(string name, string dllName, string entryName, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type returnType, System.Type[] parameterTypes, System.Runtime.InteropServices.CallingConvention nativeCallConv, System.Runtime.InteropServices.CharSet nativeCharSet) { throw new PlatformNotSupportedException(); }
  45. public System.Reflection.Emit.TypeBuilder DefineType(string name) { throw new PlatformNotSupportedException(); }
  46. public System.Reflection.Emit.TypeBuilder DefineType(string name, System.Reflection.TypeAttributes attr) { throw new PlatformNotSupportedException(); }
  47. public System.Reflection.Emit.TypeBuilder DefineType(string name, System.Reflection.TypeAttributes attr, System.Type parent) { throw new PlatformNotSupportedException(); }
  48. public System.Reflection.Emit.TypeBuilder DefineType(string name, System.Reflection.TypeAttributes attr, System.Type parent, int typesize) { throw new PlatformNotSupportedException(); }
  49. public System.Reflection.Emit.TypeBuilder DefineType(string name, System.Reflection.TypeAttributes attr, System.Type parent, System.Reflection.Emit.PackingSize packsize) { throw new PlatformNotSupportedException(); }
  50. public System.Reflection.Emit.TypeBuilder DefineType(string name, System.Reflection.TypeAttributes attr, System.Type parent, System.Reflection.Emit.PackingSize packingSize, int typesize) { throw new PlatformNotSupportedException(); }
  51. public System.Reflection.Emit.TypeBuilder DefineType(string name, System.Reflection.TypeAttributes attr, System.Type parent, System.Type[] interfaces) { throw new PlatformNotSupportedException(); }
  52. public System.Reflection.Emit.FieldBuilder DefineUninitializedData(string name, int size, System.Reflection.FieldAttributes attributes) { throw new PlatformNotSupportedException(); }
  53. public override bool Equals(object obj) { throw new PlatformNotSupportedException(); }
  54. public System.Reflection.MethodInfo GetArrayMethod(System.Type arrayClass, string methodName, System.Reflection.CallingConventions callingConvention, System.Type returnType, System.Type[] parameterTypes) { throw new PlatformNotSupportedException(); }
  55. public System.Reflection.Emit.MethodToken GetArrayMethodToken(System.Type arrayClass, string methodName, System.Reflection.CallingConventions callingConvention, System.Type returnType, System.Type[] parameterTypes) { throw new PlatformNotSupportedException(); }
  56. public System.Reflection.Emit.MethodToken GetConstructorToken(System.Reflection.ConstructorInfo con) { throw new PlatformNotSupportedException(); }
  57. public System.Reflection.Emit.MethodToken GetConstructorToken(System.Reflection.ConstructorInfo constructor, System.Collections.Generic.IEnumerable<System.Type> optionalParameterTypes) { throw new PlatformNotSupportedException(); }
  58. public System.Reflection.Emit.FieldToken GetFieldToken(System.Reflection.FieldInfo field) { throw new PlatformNotSupportedException(); }
  59. public override int GetHashCode() { throw new PlatformNotSupportedException(); }
  60. public System.Reflection.Emit.MethodToken GetMethodToken(System.Reflection.MethodInfo method) { throw new PlatformNotSupportedException(); }
  61. public System.Reflection.Emit.MethodToken GetMethodToken(System.Reflection.MethodInfo method, System.Collections.Generic.IEnumerable<System.Type> optionalParameterTypes) { throw new PlatformNotSupportedException(); }
  62. public System.Reflection.Emit.SignatureToken GetSignatureToken(byte[] sigBytes, int sigLength) { throw new PlatformNotSupportedException(); }
  63. public System.Reflection.Emit.SignatureToken GetSignatureToken(System.Reflection.Emit.SignatureHelper sigHelper) { throw new PlatformNotSupportedException(); }
  64. public System.Reflection.Emit.StringToken GetStringConstant(string str) { throw new PlatformNotSupportedException(); }
  65. public System.Reflection.Emit.TypeToken GetTypeToken(string name) { throw new PlatformNotSupportedException(); }
  66. public System.Reflection.Emit.TypeToken GetTypeToken(System.Type type) { throw new PlatformNotSupportedException(); }
  67. public bool IsTransient() { throw new PlatformNotSupportedException(); }
  68. public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute) => throw new PlatformNotSupportedException();
  69. public void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder) => throw new PlatformNotSupportedException();
  70. public void SetUserEntryPoint(System.Reflection.MethodInfo entryPoint) => throw new PlatformNotSupportedException();
  71. }
  72. public readonly partial struct MethodToken : System.IEquatable<MethodToken>
  73. {
  74. public static readonly System.Reflection.Emit.MethodToken Empty;
  75. public int Token { get { throw new PlatformNotSupportedException(); } }
  76. public override bool Equals(object obj) { throw new PlatformNotSupportedException(); }
  77. public bool Equals(System.Reflection.Emit.MethodToken obj) { throw new PlatformNotSupportedException(); }
  78. public override int GetHashCode() { throw new PlatformNotSupportedException(); }
  79. public static bool operator ==(System.Reflection.Emit.MethodToken a, System.Reflection.Emit.MethodToken b) { throw new PlatformNotSupportedException(); }
  80. public static bool operator !=(System.Reflection.Emit.MethodToken a, System.Reflection.Emit.MethodToken b) { throw new PlatformNotSupportedException(); }
  81. }
  82. public readonly partial struct SignatureToken : System.IEquatable<SignatureToken>
  83. {
  84. public static readonly System.Reflection.Emit.SignatureToken Empty;
  85. public int Token { get { throw new PlatformNotSupportedException(); } }
  86. public override bool Equals(object obj) { throw new PlatformNotSupportedException(); }
  87. public bool Equals(System.Reflection.Emit.SignatureToken obj) { throw new PlatformNotSupportedException(); }
  88. public override int GetHashCode() { throw new PlatformNotSupportedException(); }
  89. public static bool operator ==(System.Reflection.Emit.SignatureToken a, System.Reflection.Emit.SignatureToken b) { throw new PlatformNotSupportedException(); }
  90. public static bool operator !=(System.Reflection.Emit.SignatureToken a, System.Reflection.Emit.SignatureToken b) { throw new PlatformNotSupportedException(); }
  91. }
  92. public readonly partial struct FieldToken : System.IEquatable<FieldToken>
  93. {
  94. public static readonly System.Reflection.Emit.FieldToken Empty;
  95. public int Token { get { throw new PlatformNotSupportedException(); } }
  96. public override bool Equals(object obj) { throw new PlatformNotSupportedException(); }
  97. public bool Equals(System.Reflection.Emit.FieldToken obj) { throw new PlatformNotSupportedException(); }
  98. public override int GetHashCode() { throw new PlatformNotSupportedException(); }
  99. public static bool operator ==(System.Reflection.Emit.FieldToken a, System.Reflection.Emit.FieldToken b) { throw new PlatformNotSupportedException(); }
  100. public static bool operator !=(System.Reflection.Emit.FieldToken a, System.Reflection.Emit.FieldToken b) { throw new PlatformNotSupportedException(); }
  101. }
  102. public readonly partial struct StringToken : System.IEquatable<StringToken>
  103. {
  104. public int Token { get { throw new PlatformNotSupportedException(); } }
  105. public override bool Equals(object obj) { throw new PlatformNotSupportedException(); }
  106. public bool Equals(System.Reflection.Emit.StringToken obj) { throw new PlatformNotSupportedException(); }
  107. public override int GetHashCode() { throw new PlatformNotSupportedException(); }
  108. public static bool operator ==(System.Reflection.Emit.StringToken a, System.Reflection.Emit.StringToken b) { throw new PlatformNotSupportedException(); }
  109. public static bool operator !=(System.Reflection.Emit.StringToken a, System.Reflection.Emit.StringToken b) { throw new PlatformNotSupportedException(); }
  110. }
  111. public readonly partial struct TypeToken : System.IEquatable<TypeToken>
  112. {
  113. public static readonly System.Reflection.Emit.TypeToken Empty;
  114. public int Token { get { throw new PlatformNotSupportedException(); } }
  115. public override bool Equals(object obj) { throw new PlatformNotSupportedException(); }
  116. public bool Equals(System.Reflection.Emit.TypeToken obj) { throw new PlatformNotSupportedException(); }
  117. public override int GetHashCode() { throw new PlatformNotSupportedException(); }
  118. public static bool operator ==(System.Reflection.Emit.TypeToken a, System.Reflection.Emit.TypeToken b) { throw new PlatformNotSupportedException(); }
  119. public static bool operator !=(System.Reflection.Emit.TypeToken a, System.Reflection.Emit.TypeToken b) { throw new PlatformNotSupportedException(); }
  120. }
  121. public partial class DynamicILInfo
  122. {
  123. internal DynamicILInfo() => throw new PlatformNotSupportedException();
  124. public System.Reflection.Emit.DynamicMethod DynamicMethod { get { throw new PlatformNotSupportedException(); } }
  125. public int GetTokenFor(byte[] signature) { throw new PlatformNotSupportedException(); }
  126. public int GetTokenFor(System.Reflection.Emit.DynamicMethod method) { throw new PlatformNotSupportedException(); }
  127. public int GetTokenFor(System.RuntimeFieldHandle field) { throw new PlatformNotSupportedException(); }
  128. public int GetTokenFor(System.RuntimeFieldHandle field, System.RuntimeTypeHandle contextType) { throw new PlatformNotSupportedException(); }
  129. public int GetTokenFor(System.RuntimeMethodHandle method) { throw new PlatformNotSupportedException(); }
  130. public int GetTokenFor(System.RuntimeMethodHandle method, System.RuntimeTypeHandle contextType) { throw new PlatformNotSupportedException(); }
  131. public int GetTokenFor(System.RuntimeTypeHandle type) { throw new PlatformNotSupportedException(); }
  132. public int GetTokenFor(string literal) { throw new PlatformNotSupportedException(); }
  133. [System.CLSCompliantAttribute(false)]
  134. public unsafe void SetCode(byte* code, int codeSize, int maxStackSize) => throw new PlatformNotSupportedException();
  135. public void SetCode(byte[] code, int maxStackSize) => throw new PlatformNotSupportedException();
  136. [System.CLSCompliantAttribute(false)]
  137. public unsafe void SetExceptions(byte* exceptions, int exceptionsSize) => throw new PlatformNotSupportedException();
  138. public void SetExceptions(byte[] exceptions) => throw new PlatformNotSupportedException();
  139. [System.CLSCompliantAttribute(false)]
  140. public unsafe void SetLocalSignature(byte* localSignature, int signatureSize) => throw new PlatformNotSupportedException();
  141. public void SetLocalSignature(byte[] localSignature) => throw new PlatformNotSupportedException();
  142. }
  143. public readonly partial struct EventToken : System.IEquatable<EventToken>
  144. {
  145. public static readonly System.Reflection.Emit.EventToken Empty;
  146. public int Token { get { throw new PlatformNotSupportedException(); } }
  147. public override bool Equals(object obj) { throw new PlatformNotSupportedException(); }
  148. public bool Equals(System.Reflection.Emit.EventToken obj) { throw new PlatformNotSupportedException(); }
  149. public override int GetHashCode() { throw new PlatformNotSupportedException(); }
  150. public static bool operator ==(System.Reflection.Emit.EventToken a, System.Reflection.Emit.EventToken b) { throw new PlatformNotSupportedException(); }
  151. public static bool operator !=(System.Reflection.Emit.EventToken a, System.Reflection.Emit.EventToken b) { throw new PlatformNotSupportedException(); }
  152. }
  153. public readonly partial struct ParameterToken : System.IEquatable<ParameterToken>
  154. {
  155. public static readonly System.Reflection.Emit.ParameterToken Empty;
  156. public int Token { get { throw new PlatformNotSupportedException(); } }
  157. public override bool Equals(object obj) { throw new PlatformNotSupportedException(); }
  158. public bool Equals(System.Reflection.Emit.ParameterToken obj) { throw new PlatformNotSupportedException(); }
  159. public override int GetHashCode() { throw new PlatformNotSupportedException(); }
  160. public static bool operator ==(System.Reflection.Emit.ParameterToken a, System.Reflection.Emit.ParameterToken b) { throw new PlatformNotSupportedException(); }
  161. public static bool operator !=(System.Reflection.Emit.ParameterToken a, System.Reflection.Emit.ParameterToken b) { throw new PlatformNotSupportedException(); }
  162. }
  163. public readonly partial struct PropertyToken : System.IEquatable<PropertyToken>
  164. {
  165. public static readonly System.Reflection.Emit.PropertyToken Empty;
  166. public int Token { get { throw new PlatformNotSupportedException(); } }
  167. public override bool Equals(object obj) { throw new PlatformNotSupportedException(); }
  168. public bool Equals(System.Reflection.Emit.PropertyToken obj) { throw new PlatformNotSupportedException(); }
  169. public override int GetHashCode() { throw new PlatformNotSupportedException(); }
  170. public static bool operator ==(System.Reflection.Emit.PropertyToken a, System.Reflection.Emit.PropertyToken b) { throw new PlatformNotSupportedException(); }
  171. public static bool operator !=(System.Reflection.Emit.PropertyToken a, System.Reflection.Emit.PropertyToken b) { throw new PlatformNotSupportedException(); }
  172. }
  173. }
  174. #endif